-
Notifications
You must be signed in to change notification settings - Fork 2k
feat(list): add disableTakeFocusOnClick option to CheckListPlugin (#7689) #7696
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
base: main
Are you sure you want to change the base?
Conversation
…cebook#7689)\n\nAdds an option to disable focusing the editor on checklist item click, which helps avoid unwanted keyboard popups on mobile. Fixes facebook#7689.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hi @mrbuddhu! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Signed CLA |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Not stealing the cursor focus upon clicking a checkbox should be the default behaviour IMO. Playing with the PR preview, it only works if I tick the checkbox that is on the same line as the caret, but not if I check/uncheck box 1, when the caret is on line 3, it still steals the focus. |
|
||
export function registerCheckList( | ||
editor: LexicalEditor, | ||
options?: { disableTakeFocusOnClick?: boolean } | ||
): () => void; |
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.
This shouldn't be here
export function registerCheckList( | |
editor: LexicalEditor, | |
options?: { disableTakeFocusOnClick?: boolean } | |
): () => void; |
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.
I think it would be more useful if it just worked in the expected way, especially on mobile. It's hard to review this without any live environment or tests that demonstrates the usage, it just adds a toggle but you can't turn it on without editing the code and running it locally.
For all I know there could be a separate issue related to focus if there happens to be an existing selection when this node is mutated but I can't quickly verify if that's the case or not.
Summary
Adds a
disableTakeFocusOnClick
option to the CheckListPlugin, allowing users to disable focusing the editor when a checklist item is clicked. This is especially useful on mobile, where focusing brings up the keyboard unnecessarily.Fixes #7689
Test Plan
disableTakeFocusOnClick={true}
to the CheckListPlugin.