Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#11295 closed defect (fixed)

[regression] FilteringSelect value not set when you mouse to paste value

Reported by: eescobar Owned by: Douglas Hays
Priority: high Milestone: 1.5
Component: Dijit - Form Version: 1.4.1
Keywords: FilteringSelect Cc: edgar_escobar@…
Blocked By: Blocking:

Description

Prior to Dojo 1.4.1 and after Dojo 1.1.1, users were able to copy text form a valid option inside a FilteringSelect? dijit with their mouse using the context menu and then paste the text using their mouse into another FilteringSelect? dijit that uses the same store. The value that was pasted would then be used to set the value of dijit.

Steps to reproduce: 1) Create a datastore 2) Create 2 FilteringSelect? dijits (dijit A and dijit B) that use the same datastore 3) Click on dijit A and select a valid value. 4) Using the mouse, hightlight the value and then right click so that the mouse's context menu shows. 5) Select the Copy option 6) Clicking into dijit B 7) Using the mouse, make a right click and choose the paste option 8) Tab out or click out out of dijit B

Using Firebug, you should see that the value of dijit B isn't set to the value that was copied from dijit A. Based on whether or not you set the required flag, dijit B may show the value that was pasted in as invalid, even though it is a valid value.

In the attached file, you can see that if you copy a valid value form the orgState dijit then use the mouse to paste that value in the destState dijit, that when you click on the showData button that the destState dijit value isn't set.

Based on some initial analysis, it looks like the following revision caused the issue: http://bugs.dojotoolkit.org/changeset/20406/dijit/trunk/form/ComboBox.js

It looks like line# should also include an additional condition:

if(typeof this.item == "undefined"
this._lastDisplayedValue!=newvalue)

Adding this seemed to work and also cause some of our old Selenium scripts to work as well that were broken after we upgrade to 1.4.1

Dojo Version: 1.4.1+

Browser Types: FF 3.5+ IE6 SP3+ OS and OS Version: Windows XP SP3

Attachments (2)

dojoFilteringSelectIssue.html (2.4 KB) - added by eescobar 9 years ago.
Example
11295.patch (783 bytes) - added by Douglas Hays 9 years ago.
patch against 1.5 trunk

Download all attachments as: .zip

Change History (16)

Changed 9 years ago by eescobar

Example

comment:1 Changed 9 years ago by eescobar

The description is missing the line number and or i added to the condition. It should say "...looks like line number 431 should also include an additional condition:

if(typeof this.item == "undefined"
this._lastDisplayedValue!=newvalue)

"

Changed 9 years ago by Douglas Hays

Attachment: 11295.patch added

patch against 1.5 trunk

comment:2 Changed 9 years ago by Douglas Hays

Please test the attached patch to check for regressions against different browsers. The same fix should work on 1.4. Pasting text will now act like it was typed and performed a search.

comment:3 Changed 9 years ago by Douglas Hays

Owner: set to Douglas Hays
Status: newassigned

comment:4 Changed 9 years ago by eescobar

It doesn't seem to work if you are using a QueryReadStore? with the FilteringSelect?. If you copy and paste the value, it shows the dropdown with the value you pasted hightlight but doesn't select it on blur. Currently if you tab out of the dijit or click somewhere else(onBlur),it sets the value of the dijit to the first value in the list. When using the QueryReadStore?, after the paste the user has to click on the value before the value gets set.

For an ItemFileReadStore?, once you paste the value it automatically sets the value to the pasted value on blur.

comment:5 Changed 9 years ago by Douglas Hays

The QueryReadStore? complaint doesn't really have anything to do with paste (or this ticket) does it? You should be able to run dojox/data/demos/demo_QueryReadStore_FilteringSelect.html without using paste (just typing) to observe the same results.

comment:6 Changed 9 years ago by eescobar

I think it an issue with the paste because before the patch if you were using a QueryReadStore? and just used ctrl+v to paste the text it would set the value accordingly. Now after the patch, that doesn't even work. Its selecting the first item in the list and not the item that matches the pasted text. Just like when you paste using the mouse.

If you do not think this is an issue related to this ticket, should I create another one? If, so would it be a ticket related to the QueryReadStore? or FilteringSelect? dijit.

Thanks,

Eddie

comment:7 Changed 9 years ago by eescobar

Please disregard my last comment. My configuration was not correct. I fixed it and it works correctly with the ItemFileReadStore? or QueryReadStore?. Sorry.

comment:8 Changed 9 years ago by eescobar

I did notice something else that existed before the patch with regards to pasting and was wondering if it was a bug or not. Steps to reproduce: 1) Create a QueryReadStore? 2) Use the QueryReadStore? as the store for 2 FilteringSelect? dijits 3) Copy the value from one of the dijits to the other using either keyboard shortcuts or the mouse.

You will notice that right after you paste the data that the dijit shows as an invalid state, then becomes valid after the fetch gets executed and a match is found. This seems to only happen the first time you paste into the dijit. If you have previous clicked into a dijit and then pasted another valid value into it, the new valid value doesn't show as being in an invalid state.

Shouldn't this work as the opposite. So that when you paste the text, the pasted text shows up as valid and then after the fetch gets execute, if the item isn't found then show it as invalid.

Our user's are getting confused as why it shows up as invalid right after the paste.

If needed, I can create another ticket for this.

comment:9 Changed 9 years ago by Douglas Hays

Milestone: tbd1.5

I saw that as well. Please create another ticket. It has nothing to do with paste. You can type the letter n after loading your test page and you can see it turn yellow before showing the dropdown list. It's probably just a timing issue between when the text is typed and when the results come back asynchronously. Technically it is invalid until results come back. Feel free to post a patch.

comment:10 Changed 9 years ago by Douglas Hays

Summary: FilteringSelect value not set when you mouse to paste value[regression] FilteringSelect value not set when you mouse to paste value

comment:11 Changed 9 years ago by Douglas Hays

Milestone: 1.51.5.1

comment:12 Changed 9 years ago by bill

Milestone: 1.5.11.5

Moving this back to 1.5 since rc1 is clearly is being treated as a beta.

comment:13 Changed 9 years ago by Douglas Hays

Resolution: fixed
Status: assignedclosed

(In [22360]) Fixes #11295. Perform a delayed search after mouse paste.

comment:14 Changed 9 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.