Opened 5 years ago

Last modified 3 years ago

#18376 new defect

Users go back a page when pressing backspace when the DateTextBox is open

Reported by: cstephe Owned by:
Priority: undecided Milestone: 1.15
Component: Dijit - Form Version: 1.9.2
Keywords: Cc:
Blocked By: Blocking:

Description

Users go back a page when pressing backspace when the DateTextBox? is open.

Change History (5)

comment:1 Changed 4 years ago by dylan

Milestone: tbd1.11
Owner: set to cstephe
Status: newpending

Worst browser idea ever to make the backspace key take you back a page.

Easiest solution is to add an event handler using dojo/on to document.body for a keypress event, and if it's the backspace key, call event.preventDefault();

Sounds like in your app the issue is a focus issue, e.g. the focus is not on the text box associated with the DateTextBox??

comment:2 Changed 4 years ago by bill

Owner: cstephe deleted
Status: pendingnew

As you suspected, when the calendar dropdown is open, the focus is on the calendar, not the <input>. Likewise for a dropdown button with a ColorPicker?, the dropdown list of a Select, a Menu, etc.

I'm not sure how many of those backspace keys we should be preventing. Ideally I don't want to change to change the page level behavior of the backspace key just because we think the default behavior is stupid. I guess DateTextBox? is more debatable because it might seem like the focus is on the <input> and as such, backspace should just delete a character. Although it's strange to use backspace when the dropdown is already open.

Last edited 4 years ago by bill (previous) (diff)

comment:3 Changed 4 years ago by bill

PS: the other approach would be to always leave focus on the <input>, like what happens with TimeTextBox?, and then just forward keystrokes from the DateTextBox?'s <input> to the Calendar popup widget.

Last edited 4 years ago by bill (previous) (diff)

comment:4 Changed 4 years ago by dylan

Milestone: 1.111.12

comment:5 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.