These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 3:59 pm Advanced search

menuitem & menu events don't indicate triggering element

Do you think the HTML spec should do something differently? You can discuss spec feedback here, but you should send it to the WHATWG mailing list or file a bug in the W3C bugzilla for it to be considered.

menuitem & menu events don't indicate triggering element

Postby SignpostMarv » Sat Apr 21, 2012 9:14 pm

w3c bug over here: https://www.w3.org/Bugs/Public/show_bug.cgi?id=16816

The basic gist is that I'm trying to use a menu on several elements to trigger further actions on the site (search a different section, add user to friends list, go to a different section for the same result rather than the section the result link takes you to when clicked) based upon the textContent of the search result element.

The click event for a menuitem doesn't seem to indicate which page element a context menu was triggered on, meaning you have to add an event listener to the contextmenu event then set a variable accessible from the menuitem click event handler's scope (see http://pastebin.com/7kS8tu2W for example of this workaround).

Similarly, the show event for menu elements don't indicate the element that triggered the context menu.
SignpostMarv
<h6>
 
Posts: 1
Joined: Sat Apr 21, 2012 8:59 pm

Return to Feedback on the Specs

Who is online

Users browsing this forum: No registered users and 1 guest