Skip to content

Dynamic update <style> is not handled by polyfill #76

Open
@katmai7

Description

@katmai7

Hi,
I found out that when <style> is dynamically updated with new css, polyfill doesn't handle it.

Example: https://stackblitz.com/edit/js-pkkkut?file=index.js,style.css,index.html,tsconfig.json

After some research I found that the polyfill should parse and apply polyfill logic again after <style> was updated

I've tried to do naive fix and implement update method for StyleElementController:

updated() {
  this.controller?.abort()
  this.connected();
}

But I'm not sure if it a right place to do it.

What is the proper way to make it handle this case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions