You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current state of the explainer following the changes for #1456 is that I've only made the small change from command=toggle-menu to command=toggle-popover so that the pattern for a <button> that opens a <menulist> is now:
<buttoncommand=toggle-popovercommandfor=mymenu><menulistid=mymenu>
...menuitems go here...
</menulist>
or maybe even:
<buttonpopovertarget=mymenu><menulistid=mymenu>
...menuitems go here...
</menulist>
I was thinking this was fine because buttons invoking menus didn't need any special behavior, and it would be fine if all of the special behavior were inside the <menulist> which is a popover.
One thing @mfreed7 asked me about yesterday is whether that's actually correct. In particular he suggested that we probably want to support the gesture involving:
This is a special behavior that isn't automatically implied by the above markup. And, in particular, the solution that the pointer events experts we've talked to so far are suggesting for #1312 is that we do event retargeting similar to what is done for the <label> element, which requires that we have an ancestor-or-self of the normal target of the click event (which is the nearest common ancestor of the mousedown element and the mouseup element). So if we want to do this we probably need a menu-specific element that contains both the <button> and the <menulist>. @mfreed7 suggested that <submenu> might be appropriate.
So I guess then the question is whether we should consider doing this. We could consider wrapping something like the above in a <submenu>... and then maybe also removing the markup above and making the <submenu> imply the invoking behavior just like it does for <menuitem>.
In whatwg/html#11729 (comment), whatwg/html#11729 (comment), whatwg/html#11729 (comment), and whatwg/html#11729 (comment) we had some discussion about what the pattern should be for
<button>elements that open a<menulist>, in particular as a result of the changes from #1456. (I think it was mostly me and @lukewarlow though I think @scottaohara was also interested.)The current state of the explainer following the changes for #1456 is that I've only made the small change from
command=toggle-menutocommand=toggle-popoverso that the pattern for a<button>that opens a<menulist>is now:or maybe even:
I was thinking this was fine because buttons invoking menus didn't need any special behavior, and it would be fine if all of the special behavior were inside the
<menulist>which is a popover.One thing @mfreed7 asked me about yesterday is whether that's actually correct. In particular he suggested that we probably want to support the gesture involving:
<button>clickevent (see [menu] Should an event be fired when a <menuitem> is selected? Which event? #1312)This is a special behavior that isn't automatically implied by the above markup. And, in particular, the solution that the pointer events experts we've talked to so far are suggesting for #1312 is that we do event retargeting similar to what is done for the
<label>element, which requires that we have an ancestor-or-self of the normal target of theclickevent (which is the nearest common ancestor of the mousedown element and the mouseup element). So if we want to do this we probably need a menu-specific element that contains both the<button>and the<menulist>. @mfreed7 suggested that<submenu>might be appropriate.So I guess then the question is whether we should consider doing this. We could consider wrapping something like the above in a
<submenu>... and then maybe also removing the markup above and making the<submenu>imply the invoking behavior just like it does for<menuitem>.Thoughts?