-
-
Notifications
You must be signed in to change notification settings - Fork 767
fix(ui): commit popover forms through submit, not a key handler #3030
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
Open
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e3c57ac
fix(ui): commit popover forms through submit, not a key handler
YousefED 313e6f8
fix(ui): one submit control per form, and reuse mergeRefs
YousefED 5961b49
test(ui): cover the composition guard, and drop two tests that couldn…
YousefED 06ec2f1
fix(ui): drop the composition guard — native submission already handl…
YousefED 937f4ac
fix(ui): every form declares its submit control explicitly
YousefED 75368c2
test: platform-contract suites get their own directory
YousefED 8dd7b8d
docs(mantine): portalling TODO and the focus-trap contract
YousefED 977c9bf
refactor(ui): one autofocus implementation, shared as useAutoFocus
YousefED 1e91a4d
refactor(ui): review follow-ups on focus ownership and docs
YousefED 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
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
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
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
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
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 |
|---|---|---|
|
|
@@ -406,5 +406,6 @@ export const ar: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "موافق", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -440,5 +440,6 @@ export const de: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Strg", | ||
| form_submit: "OK", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -421,5 +421,6 @@ export const en = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "OK", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -419,5 +419,6 @@ export const es: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "Aceptar", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -390,5 +390,6 @@ export const fa = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "تأیید", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -467,5 +467,6 @@ export const fr: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "OK", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -421,5 +421,6 @@ export const he: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "אישור", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -435,5 +435,6 @@ export const hr: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "U redu", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -435,5 +435,6 @@ export const is: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "Í lagi", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -443,5 +443,6 @@ export const it: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "OK", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -461,5 +461,6 @@ export const ja: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "OK", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -434,5 +434,6 @@ export const ko: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "확인", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -422,5 +422,6 @@ export const nl: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "OK", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -439,5 +439,6 @@ export const no: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "OK", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -412,5 +412,6 @@ export const pl: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "OK", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -414,5 +414,6 @@ export const pt: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "OK", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -465,5 +465,6 @@ export const ru: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "ОК", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -419,5 +419,6 @@ export const sk = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "OK", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -445,5 +445,6 @@ export const uk: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "ОК", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -455,5 +455,6 @@ export const uz: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "OK", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -420,5 +420,6 @@ export const vi: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "OK", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -462,5 +462,6 @@ export const zhTW: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "確定", | ||
| }, | ||
| }; | ||
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 |
|---|---|---|
|
|
@@ -462,5 +462,6 @@ export const zh: Dictionary = { | |
| }, | ||
| generic: { | ||
| ctrl_shortcut: "Ctrl", | ||
| form_submit: "确定", | ||
| }, | ||
| }; | ||
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
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
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 |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import { assertEmpty } from "@blocknote/core"; | ||
| import { ComponentProps } from "@blocknote/react"; | ||
|
|
||
| export const Form = (props: ComponentProps["Generic"]["Form"]["Root"]) => { | ||
| const { children, onSubmit, submitButton, ...rest } = props; | ||
|
|
||
| assertEmpty(rest); | ||
|
|
||
| return ( | ||
| <form | ||
| className={"bn-form"} | ||
| onSubmit={(event) => { | ||
| // These forms have no action — a real submission would navigate. | ||
| event.preventDefault(); | ||
| onSubmit?.(); | ||
| }} | ||
| > | ||
| {children} | ||
| {submitButton === "none" ? null : submitButton} | ||
| </form> | ||
| ); | ||
| }; |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.