Bug Tracker

Modify

Ticket #6826 (closed bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

$('input[value=...]') doesn't work correctly in Firefox, Chrome, and Safari

Reported by: jaeheung Owned by:
Priority: undecided Milestone: 1.4.3
Component: selector Version: 1.4.2
Keywords: value attribute selector Cc:
Blocking: Blocked by:

Description

Try the attached test code. Click one of three words in the first line to change the value of the text box, and push the button to test various selectors.

It works as expected in IE. It should show:

1 0 0

1 0 0

or

0 1 0

0 1 0

or

0 0 1

0 0 1

depending on the selected value.

But it shows strange results in non-IE browsers.

Attachments

t.html Download (935 bytes) - added by jaeheung 3 years ago.
test page

Change History

Changed 3 years ago by jaeheung

test page

comment:1 Changed 3 years ago by addyosmani

  • Priority set to undecided

Tests across browsers using submitted code sample:

Chrome 6.04:

Original: {100,100}, One: {100, 100}, Two Words: {100, 101}

FireFox 3.6.10:

Original: {100,100}, One: {100, 100}, Two Words: {100, 101}

IE9:

Original: {100,100}, One: {010, 010}, Two Words: {001,001}

On first glances it would appear that FireFox and Chrome are behaving incorrectly, however if you set the input value to one of those terms explicitly (without JS setting the input value dynamically), you'll see these browsers working perfectly fine with the given selectors:

One:  http://jsfiddle.net/Zjt7j/3/ Two Words:  http://jsfiddle.net/Zjt7j/4/

(we get the same results as in IE)

Going back to your original code..

I don't believe the problem is that jQuery isn't able to use the selectors correctly (as confirmed above). I believe there may be a quirk in the way the input value is being dynamically set (however that said, it looks fine to me).

Requesting an additional review to clarify whether the issue is indeed as I suspect, with the way the input value is being set or whether this is symptomatic of a larger problem.

comment:2 Changed 3 years ago by adipose

I just submitted what appears to be a duplicate of this bug.

 http://dev.jquery.com/ticket/7128

I ended up using filter() instead to get the desired results.

comment:3 Changed 3 years ago by adipose

I forgot to mention the workaround:

$('@input[value=...]') works, for some reason.

$('&input[value=...]') also works. I have no idea why.

comment:4 Changed 3 years ago by addyosmani

  • Status changed from new to closed
  • Resolution set to duplicate

As the content's of your second bug report (#7128) on this issue mimic quite a lot of the core issues explained via your test case in this ticket, I am closing this ticket as a duplicate. We've managed to make some further progress in the discussion on how this bug should be handled there and I think there is greater benefit in continuing the attempt to resolve this bug through that ticket instead of leaving two open.

comment:5 Changed 3 years ago by addyosmani

Duplicate of #7128.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.