Given an XUL dialog box like this: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?> <dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" buttons="accept,cancel"> <textbox multiline="true" rows="10" cols="40"/> </dialog> the user cannot use the Enter or Return keys in the textbox. This is because the event handlers at the end of the binding file call _hitEnter(), and the _hitEnter() function doesn't bother to check for an <html:textarea/> element. The fix should be easy: (1) Pass the event object from the handlers to the _hitEnter() method. (2) Add an evt argument to the _hitEnter() function, to receive the event object. (3) Check for ((evt.target.tagName != "textarea")&&(evt.target.namespaceURI != "http://www.w3.org/1999/xhtml")) before firing this.acceptDialog().
"patches accepted" ;)
Assignee: hyatt → hewitt
Comment on attachment 117354 [details] [diff] [review] patch It would be nice if we could check whether the event was consumed by editor, instead of checking the target like this. Unfortunately, there's no way to guarantee that this handler will be fired after editor's. sr=me.
Attachment #117354 - Flags: superreview?(bryner) → superreview+
I've been offline for a few days; can we check this in?
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
Component: XP Toolkit/Widgets: XUL → XUL
QA Contact: shrir → xptoolkit.widgets
You need to log in before you can comment on or make changes to this bug.