-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Improve the Placeholder behavior to keep shown when focused. #8474
Improve the Placeholder behavior to keep shown when focused. #8474
Conversation
huacnlee
commented
Nov 18, 2020
•
edited
Loading
edited
1ac3cd9
to
e6c2538
Compare
e6c2538
to
a75f9df
Compare
Hi @huacnlee! Thanks for this contribution. It makes perfect sense that the editor placeholder should act the same as the There's one problem, though: the image caption placeholder looks off: I think we can correct it by using which corresponds to what an The question remains: do we want this @Reinmar @magda-chrzescian? This still looks off to me. Other optionsWe could have something like below instead (
Finally, the last way would be a perfectly centered placeholder text (like above) but a caret at the beginning of it:
|
😂 That looks like too complex for me, I'm afraid that to have enough capacity to fix that. |
I would vote for center-center position. It's not perfect but I like that it seems consistent with the native input behavior and clear about the text alignment. However, maybe the caption placeholder should be invisible on focus by default? I think that the main use case of focus-visible placeholder is when you want to prompt the user to fill the input (so it should be focused and should inform of the need to be filled) - it can be common regarding the content of editor, but rather rare in the case of image caption. I really don't like the idea of caret jumping around right after the user starts to write. It would make an impression that something crashed and the user may stop writing for a second to check what happened. Besides, the initial position of caret can be confusing about how the text will be aligned. |
I forked this PR in https://github.com/ckeditor/ckeditor5/compare/i/8689-smarter-editor-placeholder?expand=1 and I came up with a configuration for I also checked the @ckeditor/qa-team, can you take a look at https://github.com/ckeditor/ckeditor5/compare/i/8689-smarter-editor-placeholder?expand=1 and see if nothing else got broken (CF?) because of this? 🙏 |
CKE 5It seems to work fine, I didn't find any new bugs. CFI had errors at the beginning, but after locally merging latest 0_comment1.mp4I'm not sure whether this was intended, but so far I didn't find any bugs related to this too. |
Thanks @huacnlee for this contribution! |
In Neos 7.3.17 and before the placeholder in ckeditor would not disappear when focused. And only when typing. By switching to the native placeholder feature of ckeditor in #3558 we introduced a regression as that implementation would hide the placeholder while just clicking into. This is especially noticeable for centered texts as the cursor needs one millisecond to adjust and its glitchy. This will eventually be fixed in Ckeditor 24 something. As a hotfix for our version 16 i introduce the patch of ckeditor/ckeditor5#8474 (without the css absolute change as that would make centered text uneditable). The mentioned fix was not merged directly into ckeditor but made way more complicated: ckeditor/ckeditor5#8867 We dont need the more complicated fix as we dont use the mentioned features of the placeholder in a image description and such.
…3864) * BUGFIX: Restore old Placeholder behavior to keep shown when focused In Neos 7.3.17 and before the placeholder in ckeditor would not disappear when focused. And only when typing. By switching to the native placeholder feature of ckeditor in #3558 we introduced a regression as that implementation would hide the placeholder while just clicking into. This is especially noticeable for centered texts as the cursor needs one millisecond to adjust and its glitchy. This will eventually be fixed in Ckeditor 24 something. As a hotfix for our version 16 i introduce the patch of ckeditor/ckeditor5#8474 (without the css absolute change as that would make centered text uneditable). The mentioned fix was not merged directly into ckeditor but made way more complicated: ckeditor/ckeditor5#8867 We dont need the more complicated fix as we dont use the mentioned features of the placeholder in a image description and such. * TASK: Move cursor before the placeholer * TASK: Hide break in placeholder context To move the cursor to the first position, the placeholder text is moved backwards. Therefore, a change with a break is disadvantageous. --------- Co-authored-by: Markus Günther <[email protected]>
…eos#3864) * BUGFIX: Restore old Placeholder behavior to keep shown when focused In Neos 7.3.17 and before the placeholder in ckeditor would not disappear when focused. And only when typing. By switching to the native placeholder feature of ckeditor in neos#3558 we introduced a regression as that implementation would hide the placeholder while just clicking into. This is especially noticeable for centered texts as the cursor needs one millisecond to adjust and its glitchy. This will eventually be fixed in Ckeditor 24 something. As a hotfix for our version 16 i introduce the patch of ckeditor/ckeditor5#8474 (without the css absolute change as that would make centered text uneditable). The mentioned fix was not merged directly into ckeditor but made way more complicated: ckeditor/ckeditor5#8867 We dont need the more complicated fix as we dont use the mentioned features of the placeholder in a image description and such. * TASK: Move cursor before the placeholer * TASK: Hide break in placeholder context To move the cursor to the first position, the placeholder text is moved backwards. Therefore, a change with a break is disadvantageous. --------- Co-authored-by: Markus Günther <[email protected]>