lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: Changing the font size when inputting does not take effect

Open zhuba-Ahhh opened this issue 1 year ago • 12 comments

Lexical version: latest

Steps To Reproduce

  1. open https://playground.lexical.dev/
  2. Change font size when inputting

https://github.com/facebook/lexical/assets/84793349/5d13a4a3-f4f7-44fa-833a-3416708fa2db

Link to code example:

The current behavior

Changing the font size when inputting does not take effect

The expected behavior

Input can change font size

zhuba-Ahhh avatar May 01 '24 07:05 zhuba-Ahhh

Hi @StyleT , I want to try this. This is the first time I am contributing to open-source. How can I assign this to myself?

CARPEDIEM05 avatar May 02 '24 12:05 CARPEDIEM05

Hi @zhuba-Ahhh @StyleT, I somewhat got the solution. It is taking effect but we have to press enter as it is been stated in onKeyDown that you have to press enter to change the state of the font size.

CARPEDIEM05 avatar May 02 '24 12:05 CARPEDIEM05

Hi @zhuba-Ahhh @StyleT, I somewhat got the solution. It is taking effect but we have to press enter as it is been stated in onKeyDown that you have to press enter to change the state of the font size.

Yes, I have found that pressing Enter is effective, but simply typing to change the value in the input box is not effective. You can try

zhuba-Ahhh avatar May 02 '24 13:05 zhuba-Ahhh

Hi @zhuba-Ahhh As like we are handling the onChange and onKeyDown event, we have to handle, onBlur event. My suggestion is to remove onKeyDown handler and just use the onBlur event to handle the change of the font.

CARPEDIEM05 avatar May 02 '24 14:05 CARPEDIEM05

Hi @zhuba-Ahhh As like we are handling the onChange and onKeyDown event, we have to handle, onBlur event. My suggestion is to remove onKeyDown handler and just use the onBlur event to handle the change of the font.

Yes, you can try it like this?

image

zhuba-Ahhh avatar May 02 '24 14:05 zhuba-Ahhh

Hi @zhuba-Ahhh , no this won't work as this will violate the max and min allowed size of the font.

CARPEDIEM05 avatar May 02 '24 14:05 CARPEDIEM05

I still think deleting the onKeyDown event is not a good idea

zhuba-Ahhh avatar May 02 '24 15:05 zhuba-Ahhh

You might be right, who will be the right person to comment on this? You or someone else? I am new to this so I don't know.

CARPEDIEM05 avatar May 02 '24 15:05 CARPEDIEM05

According to me

  1. Either to remove the onKeyDown event and add the onBlur event
  2. We can include both the event

What do you think?

CARPEDIEM05 avatar May 02 '24 15:05 CARPEDIEM05

I'm not sure if this is an issue. To change the font size you need to select the text that you need to change the font size for. If there is no selection, then it changes the font only for the text you will enter after font change.

ebads67 avatar May 02 '24 15:05 ebads67

Hi @StyleT , I want to try this. This is the first time I am contributing to open-source. How can I assign this to myself?

Just comment here that you'll work on it and submit a PR ;) Even if 2+ people submit concurrent PRs (never happens, almost) - it's ok.

StyleT avatar May 02 '24 18:05 StyleT

Hey @StyleT , I am working on it, i have submitted my code for review. So hope so that it will be assign to me.

CARPEDIEM05 avatar May 02 '24 18:05 CARPEDIEM05