This is generally related to #128, but I wanted to open a new issue specifically about changing the guidance about which key should dismiss a tooltip.
I've written and talked about this in more detail the past, but the general gist is that escape is not a good key for controlling content that appears on hover/focus. Tooltips can co-exist with other widgets where escape is already expected to do something else (e.g. close a modal, combobox, or other dropdown). Some examples where a tooltip handling escape would cause conflicts:
Even if one were to code escape in such a way that it first closes the tooltip and then performs its usual action on the second press, that causes additional problems:
I actually ran a usability study that included tooltips within modals and on elements that had dropdowns, and found that real users were not generally willing to press escape within a modal, even though I had coded it so that it would first close only the tooltip.
After brainstorming with coworkers, my suggestion for an alternative is the control key, since when pressed alone it doesn't have any conflicts with existing AT or application shortcuts that we could think of. Almost anything apart from escape would be welcome, though :)
I would almost rather the problems of the Escape key would force people to reconsider placing tooltips in those areas in the first place.
I worked at a place which used nested modals, because the love of modals was unbelievable, and it ran into exactly the same problem with dismissal, but additionally had trouble with focus management. A modal opens with a form inside. A form control opens another modal with another form. Inside that form, an alertdialog warning about impending deletion.
Maybe dancing backwards in high heels should be discouraged, with a Note on the SC?
@StommePoes I am 100% in favor of a note in the pattern language that says tooltips should not be used 馃榿.
Most helpful comment
I would almost rather the problems of the Escape key would force people to reconsider placing tooltips in those areas in the first place.
I worked at a place which used nested modals, because the love of modals was unbelievable, and it ran into exactly the same problem with dismissal, but additionally had trouble with focus management. A modal opens with a form inside. A form control opens another modal with another form. Inside that form, an alertdialog warning about impending deletion.
Maybe dancing backwards in high heels should be discouraged, with a Note on the SC?