Opened 9 years ago

Closed 9 years ago

#14053 closed defect (fixed) selectonclick doesn't work

Reported by: rjones Owned by: Douglas Hays
Priority: high Milestone: 1.8
Component: DojoX Mobile Version: 1.7.0b1
Keywords: selectonclick Cc:
Blocked By: Blocking:


looking at

The last example, "Select On Click Text Input" doesn't select the value of the input box.

Change History (6)

comment:1 Changed 9 years ago by ykami

Milestone: 1.7tbd
Owner: changed from ykami to Shane O'Sullivan

comment:2 Changed 9 years ago by James Thomas

Looking into this, the TextBoxMixin?'s onFocus method expects the following arguments:

_onFocus: function(/*String*/ by){

which corresponds to the function being called by from "dijit/focus.js"

345:	   widget._onFocus(by);

However, the Dojo Mobile input fields (TextArea? & TextBox?) don't use the focus manager to handle focus events, instead connecting directly to the "onfocus' event, as seen here:

35:	postCreate: function(){
36:		this.inherited(arguments);
37:		this.connect(this.textbox, "onfocus", "_onFocus");
38:		this.connect(this.textbox, "onblur", "_onBlur");
39:	}

This causes the following clause in "_onFocus" to fail, not running the selection code to run, as by is the event object not a text string.

if(this.selectOnClick && by == "mouse"){

I'm not sure what's the best way to fix this, as it appears dojo mobile widgets intentionally don't use the focus manager.

Last edited 9 years ago by James Thomas (previous) (diff)

comment:3 Changed 9 years ago by Douglas Hays

Owner: changed from Shane O'Sullivan to Douglas Hays

comment:4 Changed 9 years ago by Douglas Hays

Milestone: tbd1.7.2
Status: newassigned

comment:5 Changed 9 years ago by Douglas Hays


comment:6 Changed 9 years ago by Douglas Hays

Resolution: fixed
Status: assignedclosed

In [27702]:

Fixes #14053. Emulate dijit's focusmanager by calling _onFocus("mouse") for touch/focus to enable selectOnClick.

Note: See TracTickets for help on using tickets.