Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#8085 closed bug (wontfix)

Chrome and Safari updating elements that don't match selector, on browser back

Reported by: ghollins@… Owned by:
Priority: low Milestone: 1.next
Component: attributes Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:

Description

When coming back to a page via the browser back button under Chrome/Safari, some elements get wrong values. Please see the following simplified example:

http://jsfiddle.net/eGutT/6/

Here are more details: http://stackoverflow.com/questions/4823457/jquery-finding-wrong-elements-under-chrome

Change History (5)

comment:1 Changed 10 years ago by Galen Hollins <ghollins@…>

Here is another example, that's even more simplified:

http://jsfiddle.net/eGutT/9/

I'm not sure if this is a Chrome/Safari bug, or a jQuery bug...

comment:2 Changed 10 years ago by Galen Hollins <ghollins@…>

Sorry for modifying the example again, but this example more clearly shows that the weird form population only occurs when jQuery .val() methods are introduced. In the example, try commenting/uncommenting the

updateRowNums();

line of code:

http://jsfiddle.net/eGutT/12/

comment:3 Changed 10 years ago by petersendidit

The problem is that your input's do not have a name attribute. Chrome/Safari seems to try to save what you entered in to form fields when you go forward and back in the history. Because your inputs do not have name attributes its guessing which input field to put them in, and not guessing correctly.

Add name attributes to your fields and its all fixed: http://jsfiddle.net/petersendidit/eGutT/14/

Chrome/Safari probably should be checking for the id attribute of the name attribute is missing.

Version 1, edited 10 years ago by petersendidit (previous) (next) (diff)

comment:4 Changed 10 years ago by Rick Waldron

Component: unfiledattributes
Priority: undecidedlow
Resolution: wontfix
Status: newclosed

I'm seeing this too, but it's not a jQuery bug by any means. This test: http://jsfiddle.net/rwaldron/UvmDv/7/ doesn't use jQuery and has the same behaviour.

I would suggest filing this here: https://bugs.webkit.org/

comment:5 in reply to:  4 Changed 10 years ago by Galen Hollins <ghollins@…>

Replying to rwaldron:

I'm seeing this too, but it's not a jQuery bug by any means. This test: http://jsfiddle.net/rwaldron/UvmDv/7/ doesn't use jQuery and has the same behaviour.

I would suggest filing this here: https://bugs.webkit.org/

Thanks! Yes, I agree this looks like a webkit bug. I've filed a bug with webkit. Thanks, Galen

Note: See TracTickets for help on using tickets.