Dialog box with multiline textbox closes when user hits Enter in textbox

RESOLVED FIXED

Status

()

RESOLVED FIXED
16 years ago
10 years ago

People

(Reporter: WeirdAl, Assigned: hewitt)

Tracking

Trunk
x86
Windows 98
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
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
(Reporter)

Updated

16 years ago
Blocks: 113146
(Reporter)

Comment 2

16 years ago
Created attachment 117354 [details] [diff] [review]
patch

Updated

16 years ago
Attachment #117354 - Flags: superreview?(bryner)
Attachment #117354 - Flags: review+
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+
(Reporter)

Comment 4

16 years ago
I've been offline for a few days; can we check this in?
checked in.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED

Updated

10 years ago
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.