polyfills icon indicating copy to clipboard operation
polyfills copied to clipboard

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

Open jmcgavin opened this issue 2 years ago • 0 comments

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/[email protected]

Browsers affected

  • [x] Chrome
  • [x] Firefox
  • [x] Edge
  • [x] Safari
  • [x] IE 11

jmcgavin avatar Nov 20 '22 16:11 jmcgavin