-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block: rename is-selected class #19820
Conversation
i think we should hold on this PR because in G2 branch, is-selected means isSelected and there's no "selected style" anymore. |
Sure, though it's blocking some other work. You could even remove the |
@ellatrix I think some block still rely on it to show/hide things. what is this blocking? |
This:
It's fine if G2 is going to be merged this release cycle, but otherwise it would be good to fix in the meantime. |
Why not change the is-selected used in RichText? seems less risky. |
Because it's misnamed by the block, not by rich text. The block doesn't apply the |
Right, it won't be misnamed though with G2. The problem here is that two components will impact the same DOM element and this is not that common. Not opposed to rename both but let's start with RichText cause I don't expect any third-party code to rely on this class. |
Agreed. Plus the class in rich text is only used for one thing (the placeholder). |
Wondering what does "is-selected" mean for RichText? Does it mean focused? can't we use :focus or something? |
I tried to use |
Description
Blocks #19701.
This PR renames the block's
is-selected
class to the more descriptiveis-appearing-selected
class. The current class is misleading, as it may not be added even though the block is selected. The class is omitted when a block does not appear selected (when typing).This change is necessary for blocks to be able to render their own wrapper as
RichText
also has ais-selected
class, which causes a block to continuously look selected. The problem is not really the class duplication, but rather usingis-selected
to mean different things.Some more complex block may have CSS rules using this class, but
is-typing
, which maybe indicates a need for a properis-selected
class. I consider adding a new class out of scope though.How has this been tested?
Screenshots
Types of changes
Checklist: