Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vbabel
Copy link
Contributor

@vbabel vbabel commented Nov 19, 2025

This is a small fix for a minor accessibility issue, when the inspector is opened the menu buttons are no longer visible but can still be focused.

This implementation uses a intersection observer to detect when the .mb-menubar element has been inserted in the document and sets a css variable --menu-bar-height, local to the shadow host, that is used to adjust the height of the inspector panel accordingly.

If the data-autohide property is set on the .mb-menubar element, the .ip-root element is instead given padding and z-indexes are adjusted such that the menu bar can still appear above the inspector panel.

I've updated this such that the menubar will move to the left in order to accommodate the inspector panel when it is open. This involves using a css variable, --panel-width, to define the panel width and a .mb-root:has(+ .ip-root) css selector to change the menubar position when the inspector panel is present.

@vbabel
Copy link
Contributor Author

vbabel commented Nov 19, 2025

An alternative to this solution could be to hide the menu buttons when the inspector appears, or similarly bump the menubar to the left the width of the inspector panel.

Copy link
Owner

@pocka pocka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overlap was intentional, as the element is meant to be embedded and we have no control over width / height.

An alternative to this solution could be to hide the menu buttons when the inspector appears, or similarly bump the menubar to the left the width of the inspector panel.

This is the way. Menu buttons do not take much space and an inspector element has no animation, so shrinking menubar would be fine.

@vbabel
Copy link
Contributor Author

vbabel commented Nov 20, 2025

This is the way. Menu buttons do not take much space and an inspector element has no animation, so shrinking menubar would be fine.

Are you suggesting adding the data-autohide property to the menu bar when the inspector opens and unsetting it when it closes?

@pocka
Copy link
Owner

pocka commented Nov 20, 2025

This is the way. Menu buttons do not take much space and an inspector element has no animation, so shrinking menubar would be fine.

Are you suggesting adding the data-autohide property to the menu bar when the inspector opens and unsetting it when it closes?

No, I was trying to say this,

...similarly bump the menubar to the left the width of the inspector panel.

is a good idea.

However hiding the menubar sounds good too. I'd accept whichever as long as the code is simple.

@vbabel vbabel changed the title Set an use --menu-bar-height variable to prevent overlap with inspector Bump menubar to left width of Inspector Panel when open Nov 21, 2025
@vbabel
Copy link
Contributor Author

vbabel commented Nov 21, 2025

@pocka Per the description, I've updated this to reposition the menubar when the inspector panel is open. This is a much simpler solution, thanks for the feedback.

@pocka pocka merged commit 0eebc8c into pocka:master Nov 24, 2025
1 check passed
@pocka pocka added this to the v2.0.5 milestone Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants