Ticket #244 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Visual.toggle() does not compute style of display property correctly

Reported by: jsmullyan@… Owned by: somebody
Priority: normal Milestone:
Component: component1 Version:
Severity: normal Keywords:
Cc:

Description

toggle() does not work as I would expect when the actual initial display value is connected to a CSS rule rather than directly to the element's style. For instance, if you define a particular element in HTML as:

<div id="foo" class="hidden">

where hidden is defined as

.hidden { display: none;}

toggle won't know that the element is hidden, because it checks for whether "elem.style.display" is "none", rather than, say, calling getStyle(elem, 'display"), which would return the actual effective display value.

The actual effect of this is that for the first call to toggle, for an element hidden via CSS as above, toggle thinks the element is visible and disappears it. Thereafter, elem.style has the information locally and toggle works as you'd want it to.

Attachments

mochidiff (472 bytes) - added by jsmullyan@… 3 years ago.
diff against Visual.js, r1267

Change History

Changed 3 years ago by jsmullyan@…

diff against Visual.js, r1267

Changed 3 years ago by therve@…

  • status changed from new to closed
  • resolution set to fixed

Thanks, checked in [1275].

Note: See TracTickets for help on using tickets.