Closed Bug 445407 Opened 16 years ago Closed 16 years ago

text edit fields do not work right

Categories

(Toolkit Graveyard :: Spatial Navigation, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: dougt, Assigned: dougt)

References

Details

Attachments

(2 files)

when using spatial navigation, when entering into a textarea or input text, focus is lost -- and snav can't really do much.

We should detect that we are in a text field and let the default action happen if it makes sense.
clean patch.  I have another patch which includes these changes but also includes a bunch of whitespace changes to match style throughout the file.  hg diff -w was not working very well.
Attachment #329746 - Flags: review?
this is what is actually going to be checked in.

two new mochitests.  the first test is to ensure that we do the right thing when encountering a disabled element.  the second test navigates over a text input field and a text area.

all tests, no leaks.  better usability.
Attachment #329749 - Flags: review?
Attachment #329749 - Flags: review? → review?(gavin.sharp)
Comment on attachment 329746 [details] [diff] [review]
patch v.1 w/o whitespace changes

>--- /Users/dougt/Desktop/SpatialNavigation.js	2008-07-15 16:00:12.000000000 -0700
>+++ toolkit/spatial-navigation/SpatialNavigation.js	2008-07-15 15:56:51.000000000 -0700
>+  // check to see if we are in a texttarea or text input element, and if so,

"textarea"

>+  // ensure that we let the arrow keys work properly.
>+
>+  if((event.target instanceof Ci.nsIDOMHTMLInputElement && event.target.type.toLowerCase() == "text") ||
>+     event.target instanceof Ci.nsIDOMHTMLTextAreaElement ) {

nit: space before "(". no need for the toLowerCase, nsHTMLInputElement::GetType always returns a lowercase string. Do we want "password" inputs too?

>+    if (event.keyCode == event.DOM_VK_RIGHT || event.keyCode != event.DOM_VK_DOWN  )
>     window.document.commandDispatcher.advanceFocus();
>+    else
>+      window.document.commandDispatcher.rewindFocus();

Huh, so there is a rewindFocus!
Attachment #329746 - Flags: review? → review+
Comment on attachment 329749 [details] [diff] [review]
patch v.1 w/ whitespace changes and new mochi tests

>diff --git a/toolkit/library/Makefile.in b/toolkit/library/Makefile.in

>+ifdef NS_OSSO
>+EXTRA_DSO_LDOPTS += -llocation -lgpsbt
>+endif

I'm assuming this wasn't meant to be part of this patch.
Attachment #329749 - Flags: review?(gavin.sharp) → review+
oh sorry, it is cruft that landed last night.  I need to start either using mq or multiple trees.
fd1c0f6abf6d
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: