-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Bug: $getSelectionStyleValueForProperty(selection, 'font-size')
not updating correctly
#4491
Comments
Can I work on this issue. |
Sure - assigned to you |
This also reproduces for the |
This issue also happens with me. Select a text -> change the font-size -> de-select text -> re-select this text -> change the font-size -> I see the toolbar doens't update the according font-size although the text font size in editor does change. |
Hi @GAURAV1-ui, |
@GAURAV1-ui |
Is there any fix to this as of now? |
@GAURAV1-ui any progress here? @acywatson can this get unassigned/reassigned if not? |
This is what I did for a workaround. Seems like the
This seems to work well, as I have another hook which listens to editor updates and calls There may be / probably is a better solution in the core framework layer, but as a workaround it does the job. |
This seems to be a larger problem with the selection that does not reflect the correct inline style value. I have other steps to reproduce the issue. Testes on the playground https://playground.lexical.dev/ Screen.Recording.2023-09-27.at.13.44.57.mov@acywatson It's been 4+ months since it was assigned to @GAURAV1-ui but no updates. Is it possible for somebody from the lexical core team to work on it? |
hi @Piliuta and @acywatson, is this merge already in version 0.12.2? Thanks! |
The fix was merged after the @acywatson any ETA for the next release? |
Hi @Piliuta, Do you mind explaining why this PR actually fix the bug? :) Thanks, |
They are both "style" properties, so they are the same from the selection perspective. There is a bug in the core functionality that does not update the property value when the selection is not collapsed. The PR fixes the |
thanks @Piliuta for taking your time and answering me :) |
When using
$getSelectionStyleValueForProperty(selection, 'font-size')
, it does not seem to update if user changes font size on some text which has previously modified its font size. Thefont-family
property also exhibits the same behavior.Lexical version: 0.10.0
Steps To Reproduce
This can be reproduced in the https://playground.lexical.dev/:
I've also created a sandbox, see FontSizePlugin: https://codesandbox.io/s/dazzling-visvesvaraya-8pjcv5
Repro in sandbox by:
See that the text font size does change, but the
getSelectionStyleValueForProperty
result still says '24px'.The current behavior
Toolbar does not update, but text font size does change.
getSelectionStyleValueForProperty
seems to still return the original value.The expected behavior
getSelectionStyleValueForProperty
will return the new font size, so that the toolbar can update to new font size.This only happens for text that has font size changed, the initial change from no font-size to some value does seem to update correctly.
The text was updated successfully, but these errors were encountered: