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

Masterbar: fix invalid HTML markup #98510

Merged
merged 5 commits into from
Jan 21, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove code comments
ciampo committed Jan 20, 2025
commit 27215d853ad1db71a38886ec4b69f1ae5db76c8c
12 changes: 0 additions & 12 deletions client/layout/masterbar/item.tsx
Original file line number Diff line number Diff line change
@@ -227,17 +227,6 @@ class MasterbarItem extends Component< MasterbarItemProps > {
<button ref={ this.props.innerRef as LegacyRef< HTMLButtonElement > } { ...props } />
);

// Differences:
// - the wrapper div is always rendered, even when props.url is set
// - the menu item is either a `button` or an `a` (no `a` nested in `button`)'
// - as a consequence, `componentButtonRef` is not necessary anymore

// Notes to self:
// - TODO: revisit closeMenuOnOutsideInteraction logic
// - is onTouchEnd necessary?
// - are we ok without tabindex = -1?
// - is always rendering the wrapper ok?

return (
<div
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Always rendering the div could cause some styles to break, but I hopefully managed to catch and amend them all. Lots of testing needed to make sure I didn't miss any edge case

className={ clsx( 'masterbar__item-wrapper', this.props.wrapperClassName ) }
@@ -246,7 +235,6 @@ class MasterbarItem extends Component< MasterbarItemProps > {
<MenuItem
{ ...attributes }
onKeyDown={ this.props.subItems ? this.toggleMenuByKey : undefined }
// Is this necessary
onTouchEnd={ this.props.subItems ? this.toggleMenuByTouch : undefined }
>
{ this.renderChildren() }