Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13587 closed bug (notabug)

removeProp doesn't work twice

Reported by: xaviermd@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: git
Keywords: Cc:
Blocked by: Blocking:

Description

On a triggering element that remove a property of another element, if the property is set again by the browser, removeProp don't notice the change

On Chrome : a <detail> has a "open" attribute set by clicking the <summary>. If i remove this attribute via jquery, then set again by clicking <summary>, my second attempt to remove "open" is not working.

Try it with Chrome (sorry) http://jsfiddle.net/dascritch/A3HVG/1/ :

  • click the <summary>, it opens the whole <detail>
  • click the revealed link, the <detail> is hidden
  • click the <summary>, it opens again <detail>
  • click the revealed link, the <detail> won't collapse

Change History (2)

comment:1 Changed 7 years ago by dmethvin

Resolution: notabug
Status: newclosed

The docs specifically say "Do not use this method to remove native properties." Why are you using .removeProp() on DOM properties? If you pick it you will make it bleed.

Last edited 7 years ago by dmethvin (previous) (diff)

comment:2 Changed 7 years ago by gibson042

I implore you, use .prop instead: http://jsfiddle.net/A3HVG/2/

Note: See TracTickets for help on using tickets.