Fix: Hide input popover when editing Math block as HTML #72902
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Closes #72899
Fixes the issue where the LaTeX input textarea appears in the upper left corner when switching to 'Edit as HTML' mode in the Math block.
Why?
When a user selects "Edit as HTML" from the Math block options, the LaTeX input popover (TextareaControl) continues to display because it only checks if the block is selected (
isSelected), not whether it's in HTML editing mode. This causes the textarea to appear in an incorrect position (upper left corner) instead of being hidden during HTML editing.How?
useSelecthook to check the block's editing mode usinggetBlockModeselector fromblockEditorStoreclientIdprop to the component to identify the current blockisEditingAsHTMListrueTesting Instructions
x^2or\frac{a}{b})Testing Instructions for Keyboard
/mathor the inserterx^2)Shift + Alt + Z(Windows/Linux) orCtrl + Option + Z(Mac) to open the block toolbarEnterEnterShift + Alt + Z/Ctrl + Option + Zagain and select "Edit visually"Screenshots or screencast
Screen.Recording.2025-11-01.at.3.07.02.PM.mov
The LaTeX input popover is properly hidden when editing the block as HTML.|