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
Fix cursor on rich text blocks when outline mode is active #29106
Conversation
Size Change: +19 B (0%) Total Size: 1.38 MB
ℹ️ View Unchanged
|
@@ -211,6 +211,10 @@ | |||
} | |||
} | |||
|
|||
&.is-outline-mode.is-selected.rich-text { | |||
cursor: unset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know what style this is overriding? Maybe the fix is to actually remove a style (or be more specific there)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is the style being overridden.
Since we want to retain the default
cursor on hover, and expose the text
cursor on selection, I'm not sure how we can be more efficient here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we want to retain the default on "hover" unless the block is focused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To expand a bit, I don't think we should be targeting "rich-text" here, that's just an implementation detail of the block, there's no guarantee the block is using that class. We should instead use the blocks states
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, I'll try another approach.
@@ -224,6 +224,10 @@ | |||
} | |||
} | |||
|
|||
&.is-outline-mode.is-selected.is-hovered { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@youknowriad This is simpler. Blocks use their inherent cursor when hovered and selected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this works for me. Another approach would have been a :not(.is-selected)
in the other selector.
Somewhere along the road the incorrect cursor was applied to rich text elements when outline mode is active (IE in the site editor):
This PR fixes that. Here's the after: