webcomponents / polyfills

Web Components Polyfills
BSD 3-Clause "New" or "Revised" License
1.14k stars 165 forks source link

[scoped-custom-element-registry] toggleAttribute polyfill does not retain force argument #533

Closed jmcgavin closed 1 year ago

jmcgavin commented 1 year ago

Description

When calling toggleAttribute, the polyfill does not retain the force argument.

This means that when I call toggleAttribute('my-attribute', false), the attribute is applied when it should not be.

Example

// Include the scoped-custom-element-registry polyfill

this.renderRoot.querySelector('my-custom-element').toggleAttribute('my-attribute', false)

Steps to reproduce

  1. Call toggleAttribute on an element
  2. Provide 'my-attribute' as the first argument
  3. Provide false as the second argument

Expected behavior

my-attribute should not be applied to the element.

Actual behavior

my-attribute is applied to the element.

Version

@webcomponents/scoped-custom-element-registry@0.0.6

Browsers affected

bicknellr commented 1 year ago

The fix for this is available in v0.0.8.