-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[lexical-playground] Bug Fix: Added blur event #6011
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hi @CARPEDIEM05! 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! |
Hi, I'm not sure if we want to update the font size on blur event. We want to update the font size only when the user presses the enter key or any of the +/- buttons. However, it would be nice to revert to current font size value in the input field, if the user removes focus from the font input entry without pressing enter. In other words, the font size input field, when not in focus, should always show the selection font size. |
Added updated blur event which attain previous value if not committed by user
Hi @Shubhankerism, can you review this? I have updated the code according to the prev value if it is not committed by the user. |
Hi @Shubhankerism, can you review the code? |
const inputValueNumber = Number(selectionFontSize); | ||
const prevFontSize = inputValueNumber; | ||
setInputValue(String(prevFontSize)); | ||
updateFontSizeInSelection(String(prevFontSize) + 'px', null); |
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.
const inputValueNumber = Number(selectionFontSize); | |
const prevFontSize = inputValueNumber; | |
setInputValue(String(prevFontSize)); | |
updateFontSizeInSelection(String(prevFontSize) + 'px', null); | |
if (inputValue !== selectionFontSize) { | |
setInputValue(selectionFontSize); | |
} |
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.
We don't need to update the font size in selection, just update the input value.
Updated the font size on the blur event.
Hi @Shubhankerism , I tested the changes and you are right. Thank you so much for the suggestions. |
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.
Issue - Because of no blur event, there was bug with the font size not getting change and even not getting reverse to its original value.
Solution - Added the blur event.
Can you sign the CLA? |
Description
Current behaviour - > Font size was not changing even after changing the input size field.
Modified behaviour -> triggered the blur event, because of that font is changing as soon as we blur out of the input box.
Describe the changes in this pull request
Closes: #6000