-
-
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
[Style dropdown] Block style applied to the block before a block widget #11585
Comments
This seems to be consistent with the behavior of other block operations. If we select the last paragraph, the image, and the end of the heading, as in the GIF above, the style, quote, and code block operations will affect the heading block. See this video where I first select only the last paragraph and image, and then also the end of the heading. recording.mp4 |
Good find @filipsobol! I just want to share another recording that may better show where the problem is, and why it may be confusing for the user: Screen.Recording.2023-04-03.at.09.12.12.movNotice that as a user I only slightly raise my selection above the paragraph. My expectation is I select part of the paragraph, and the image. But this small selection (user's perspective), selects heading as well. It's even more visible if you have an empty paragraph. Users may have the intuition, "I only select what's on the level of my cursor", and unfortunately we break this pattern here. Not sure where the problem lies but it's still there. |
Other editors have better visual indications when end of the block is selected. Word: Google docs: |
We decided to ignore the first selected block if the selection starts at the end of that block: <paragraph>a[</paragraph> // This block should be ignored
<paragraph>b</paragraph>
<paragraph>c]</paragraph> There should be an exception if this block is empty. Such blocks are still treated as selected: <paragraph>[</paragraph> // Selection starting at the beginning of the empty block counts
<paragraph>b</paragraph>
<paragraph>c]</paragraph> We already ignore the last selected block if the selection ends at the beginning of that block: <paragraph>[a</paragraph>
<paragraph>b</paragraph>
<paragraph>]c</paragraph> // This selection is ignored However, it doesn't have the above exception, i.e. if the last block is empty, it will NOT be selected: <paragraph>[a</paragraph>
<paragraph>b</paragraph>
<paragraph>]</paragraph> // This selection is ignored To have consistent behavior, we will improve the handling for this so that the empty blocks are selected in both cases. |
I'm a bit worried about this one. And not sure if I understand it well.
But this case in style dropdown will be also confusing. It will be more visible (I will see a highlight of the selection) but the selection will still be applied when I move the cursor just above the paragraph. Right? |
Yes, currently that's the case. Interestingly, it happens on Chrome, but not in Firefox. recording.mp4 |
Fix (engine): `Selection#getSelectedBlocks()` should ignore trailing blocks where no content is selected. The selection of such blocks is not visible to the content author and is usually there unintentionally. Closes #11585.
π Provide detailed reproduction steps (if any)
βοΈ Expected result
Only blocks that are visually selected should be affected.
β Actual result
A block before a block widget gets the style.
β Possible solution
π Other details
If you'd like to see this fixed sooner, add a π reaction to this post.
The text was updated successfully, but these errors were encountered: