Opened 8 years ago
Closed 7 years ago
#14274 closed defect (patchwelcome)
dojox.mdnd prevents TextBox.selectOnClick working in IE when input is in Dialog
Reported by: | tjahelka | Owned by: | jfcunat |
---|---|---|---|
Priority: | blocker | Milestone: | tbd |
Component: | Dojox | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I have a dialog that contains a form and many input fields. I've set the selectOnClick property to true for the TextBox/ValidationTextBox? fields. If I run in FF or Chrome, then the text in the control is highlighted when the control gains focus, however it does not work in IE 7 or 8. Fields are defined as:
dataField = new dijit.form.TextBox?({
id:fieldId, title: fieldDeffield?, required:true, selectOnClick:true, style:"width:250px"
});
I've done some further research and discovered that the content on the main HTML page is somehow impacting this behavior. For example, if I have a very simple HTML page with just a button, when the dialog is opened the selectOnClick works in all browsers. If my HTML page contains any type of container (GridContainer?, BorderContainer?, etc.) selectOnClick stops working in IE.
Example of JSFiddle http://jsfiddle.net/tjahelka/8WAQv/12/ and attached as html
Attachments (1)
Change History (11)
Changed 8 years ago by
Attachment: | dialogWithForm.html added |
---|
comment:1 Changed 8 years ago by
Milestone: | 1.6.2 → tbd |
---|
comment:2 Changed 8 years ago by
comment:3 Changed 8 years ago by
Component: | Dijit - Form → DnD |
---|---|
Owner: | changed from Douglas Hays to Eugene Lazutkin |
This line in dojox/mdnd/Moveable.js is blocking text selection on any BODY child while the mouse is down without checking the mousedown target:
this._selectStart = dojo.connect(dojo.body(), "onselectstart", dojo.stopEvent);
comment:4 Changed 8 years ago by
Summary: | TextBox selectOnClick not working in IE when input is in Dialog → dojox.mdnd prevents TextBox.selectOnClick working in IE when input is in Dialog |
---|
comment:6 Changed 8 years ago by
Just in case it helps, I think this is a more generic bug, and it might be related with the issue reported on #14727 the focus problem happens also with plain html elements.
The following fiddle shows the case, I tried to put the minimum piece of code for reproducing the error http://jsfiddle.net/stefanigustavo/BcmgK/
Steps for reproducing the error
- In Firefox 10, open the fiddle
- Enter something in the textbox
- Using your mouse, try to select part of the text you have entered in step 2. You can not.
Now the weird stuff:
- If you change the "draggable" property to false everything works.
- If you remove the draggable property completely (then it will be true because that is the default value), the dialog is draggable and you do can select text correctly.
- If you set draggable to true explicitily, which should be exactly as the previous case, then you can not select part of the text you have entered in the textbox
So, at this point would be enough to not overwrite the default value, BUT, on dojox Dialog, the draggable feature does not work unless you set the property to true explicity. The default value does not work. So, if you need a draggabale dojox Dialog, there is no possible combination of options.
comment:7 Changed 8 years ago by
In my local copy of dojo, I just changed the default value of the draggable option for dojox Dialog and now everything seems to work:
// draggable: Boolean // Make the pane draggable. Differs from dijit.Dialog by setting default to false draggable: true, // simply over-ride the default from dijit.Dialog
But I guess it is overwritting the default value of the dijit Dialog for a reason....
comment:8 Changed 8 years ago by
Component: | DnD → Dojox |
---|---|
Owner: | changed from Eugene Lazutkin to tjahelka |
Status: | new → pending |
I am not an owner of dojox.mdnd. Please assign to one of these guys:
- Erwan Morvillez (emorvillez),
- Jean-Jacques Patard (jjpatard),
- Jeff Cunat (jfcunat)
comment:9 Changed 8 years ago by
Owner: | changed from tjahelka to jfcunat |
---|---|
Status: | pending → assigned |
comment:10 Changed 7 years ago by
Resolution: | → patchwelcome |
---|---|
Status: | assigned → closed |
The mdnd code seems abandoned. Closing ticket unless a patch is supplied.
It does work correctly on IE9