Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#14595 closed defect (fixed)

can't remove focusin and focusout listeners

Reported by: bill Owned by: Kris Zyp
Priority: high Milestone: 1.8
Component: Events Version: 1.7.1
Keywords: Cc:
Blocked By: Blocking:

Description

If you setup a focusin/focusout listener, and then call remove(), the listener will still be there. It's because dojo/on calls addEventListener("focus", ...) to setup the listener, but remove() calls removeEventListener("focusin", ...), which has no effect.

Can be seen by modifying Tooltip.js to connect to focusin/focusout (rather than focus/blur), and in test_Tooltip.html, press the remove button next to "t3". Note that hovering over "t3" still shows the tooltip. Tested on chrome, not sure about other browsers.

I'll check in the fix to this since I need it for #7760, but please review my change (although it seems like an obvious fix).

Change History (2)

comment:1 Changed 8 years ago by bill

Resolution: fixed
Status: newclosed

In [27526]:

Modify Tooltip to respond to focus events that occur inside of the anchor node. Fixes #7760 !strict

Also fixing bug with removing focusin/focusout listeners, exposed by Tooltip_a11y.html test after above change, fixes #14595 !strict. Seems like removing focusin/focusout listeners should be part of dijit/tests/on.html but there's not much point at the moment, because for some reason the focus tests in that file are commented out.

comment:9 Changed 8 years ago by bill

#15392 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.