Bug Tracker

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#9500 closed bug (duplicate)

$('html, body').removeAttr('style') fails in Webkit browsers.

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

Description

While doing

$('html, body').css('overflow', 'hidden');

It works, but until this part (in Webkit browsers) it fails to do this:

$('html, body').removeAttr('style');

jsFiddle test: http://jsfiddle.net/9CLfd/

Change History (4)

comment:1 Changed 5 years ago by timmywil

  • Component changed from unfiled to attributes
  • Priority changed from undecided to low
  • Status changed from new to open

This is legit, but it's a quirk in webkit: http://jsfiddle.net/timmywil/9CLfd/2/

overflow is automatically converted asynchronously to overflow-x/overflow-y, which happens after the removeAttr call. We can fix by adding a call to attr to set the style tag to empty string before removal, but I'd hate to add another function call to every removeAttr.

comment:2 Changed 5 years ago by anonymous

Ah I see now. Thanks for that fix. Surely this "bug" can be fixed in the jQuery core that remove asynchronous styles?

comment:3 Changed 5 years ago by timmywil

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

removeAttribute('style') even without this overflow conversion has problems, so I'll close this ticket as a dup of the more enveloping issue.

comment:4 Changed 5 years ago by timmywil

Duplicate of #9699.

Note: See TracTickets for help on using tickets.