-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix Enter fails to confirm in the New Document dialog after editing values #3615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
abdoshbr3322
wants to merge
6
commits into
GraphiteEditor:master
from
abdoshbr3322:fix-enter-new-document
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9481d8f
Fix enter button not working while focusing on input fields in the ne…
abdoshbr3322 9bbf242
select the pop element using it's data attribute
abdoshbr3322 60b2521
Update frontend/src/components/floating-menus/Dialog.svelte
Keavon 130c295
Use meaningful variable names
abdoshbr3322 ab0a7d1
small fix in variable names
abdoshbr3322 07d6a0d
remove redundant extra selector set on failure
abdoshbr3322 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,14 @@ | |
| // Focus the button which is marked as emphasized, or otherwise the first button, in the popup | ||
| const emphasizedOrFirstButton = (self?.div?.()?.querySelector("[data-emphasized]") || self?.div?.()?.querySelector("[data-text-button]") || undefined) as HTMLButtonElement | undefined; | ||
| emphasizedOrFirstButton?.focus(); | ||
|
|
||
| // Add an event to handle enter press on all focusable fields(inputs) inside the popup | ||
| const floatingMenu = (self?.div?.()?.querySelector("[data-floating-menu-content]") || undefined) as HTMLDivElement | undefined; | ||
| floatingMenu?.addEventListener("keydown", function (event) { | ||
| if (event.key == "Enter") { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT : maybe use === , instead of == , for string comparisons |
||
| emphasizedOrFirstButton?.click(); | ||
| } | ||
| }); | ||
| }); | ||
| </script> | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look closely at these files
MenuList.svelte:68-75
ColorPicker.svelte:408-410
ScrollbarInput.svelte:201-207
we always have a onDestroy after an onMount , not related to the changes from this PR , but would probably be a good idea to cleanup this stale event handler