Opened 11 years ago

Closed 10 years ago

#7842 closed defect (fixed)

TimeTextBox: mouseover changes starting value

Reported by: Adam Peller Owned by: Douglas Hays
Priority: high Milestone: 1.4
Component: Dijit - LnF Version: 1.2.0
Keywords: Cc: David Schwartz, Becky Gibson, Douglas Hays
Blocked By: Blocking:

Description

This one's kind of hard to describe - if you happen to have your mouse at the location of the popup when you tab into a field, the mouse position will affect the value, even if you never click the mouse.

If you bring up the test_TimeTextBox example and tab through all the fields, you'll get the values, unchanged as you'd expect. However, if you bring up the first value then select another time (like 4:00PM) with the mouse, leave the mouse still and tab through all of the fields. You'll see the values change.

Attachments (1)

7842.patch (1.6 KB) - added by Douglas Hays 10 years ago.
possible fix, not allowing TAB to select unless preceded by keyboard activity

Download all attachments as: .zip

Change History (10)

comment:1 Changed 11 years ago by David Schwartz

I don't see the pop-up control with which to choose another value with the mouse.

comment:2 Changed 11 years ago by Adam Peller

click on the input box and you will see a vertical drop down with a range of times to select from 2:00 3:00 4:00 with lines in between representing 15 minute intervals. This is the popup I'm speaking of.

comment:3 Changed 11 years ago by David Schwartz

I was using FF3 and the pop-ups weren't displaying. It works as you describe on IE7 for me. Right, so, the problem, of course, is that values are being selected based on hover rather than click. I assume that's a bug, no? I wouldn't imagine that it'd be the intended design.

This is true for scrolling as well, i.e., it should occur only on mouseDown.

comment:4 Changed 11 years ago by Adam Peller

Cc: Becky Gibson Douglas Hays added

if clicking on a TimeTextBox? on any platform does not result in a popup, that's a serious bug. (Works for me on FF3)

Yeah, I think it's the intended design, but one that needs to be thought through a bit more. Changing the widget state accidentally (w/o selecting it with focus/clicking) sounds like something which needs redesign.

comment:5 Changed 11 years ago by bill

Milestone: tbd1.4

TimeTextBox widget is wanting a big overhaul (see #7631), maybe we should wait until then to fix this... anyway scheduling for 1.4 for now.

I looked at the code for dijit._TimePicker and it seems to call _onItemSelected() on onclick, so not sure why this problem is happening.

comment:6 Changed 10 years ago by bill

Owner: set to Douglas Hays

Oh I see, it's because just tabbing away from the _TimePicker will select the hovered value, even though it wasn't clicked and neither the ENTER or SPACE key was pressed. It's because of this code in TimePicker.js which treats tab as selection:

}else if(this._highlighted_option && (e.charOrCode == dk.ENTER || e.charOrCode === dk.TAB)){
        // Accept the currently-highlighted option as the value
        if(e.charOrCode == dk.ENTER){dojo.stopEvent(e);}
        setTimeout(dojo.hitch(this, function(){
                this._onOptionSelected({target: this._highlighted_option});
        }),1);
}

Maybe we should just remove the TAB from the if()?

Changed 10 years ago by Douglas Hays

Attachment: 7842.patch added

possible fix, not allowing TAB to select unless preceded by keyboard activity

comment:7 Changed 10 years ago by Douglas Hays

Status: newassigned

comment:8 Changed 10 years ago by Douglas Hays

peller, does this patch work for you?

comment:9 Changed 10 years ago by Adam Peller

Resolution: fixed
Status: assignedclosed

(In [20362]) Committing Doug's patch, fixes #7842. Now tabbing through a TimeTextBox? will not change the value if the user mouses over the popup without clicking. !strict

Note: See TracTickets for help on using tickets.