Skip to content
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

Toolbar: Active state of formatting shortcuts should reflect selected text #2060

Closed
raineorshine opened this issue Jun 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@raineorshine
Copy link
Contributor

raineorshine commented Jun 23, 2024

When part of a thought is selected, the active state of the toolbar buttons for bold/italic/underline/strikethrought should reflect only the selected text, not the entire thought.

When no text is selected, the toolbar buttons for bold/italic/underline/strikethrough should be active if and only if all the text in the thought is formatted.

There are two incorrect cases given below. Please ensure the solution works for all types of formatting: bold, italic, underline, and strikethrough.

1. No text selected with mixed formatting

Steps to Reproduce

Hello **world**

Current Behavior

The toolbar button for bold is active.

image

Expected Behavior

The toolbar button for bold should not be active, because the thought has some non-bold characters.

2. Unformatted text selected

Steps to Reproduce

Select the word 'world'.

Current Behavior

Currently, the toolbar button for bold is active, but not for the right reason. Once the above issue is fixed, it will (incorrectly) be inactive.

Paste 2024-08-02 14 28 29

Expected Behavior

The toolbar button for bold should be active, because all selected characters are bold.

@finkef
Copy link
Collaborator

finkef commented Aug 1, 2024

#2187 partially fixes this by moving tracking of formatting commands to a separate store - triggered by selection changes and commands. In order to fully fix this issue, we would need to remove checks for HTML tags in thought content, e.g. <i>, <b>, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants