Skip to content

Using '&::placeholder' selector throws error on Chrome #2144

@gregjacobs

Description

@gregjacobs

Current behavior:

When using the '&::placeholder' selector on Chrome with the sheet in "speedy" mode (i.e. using the insertRule() API), Chrome throws errors that it can't insert the ::-moz-placeholder and ::-ms-input-placeholder rules.

Looks to also be an issue on Safari

image

To reproduce:

Enable "speedy" mode (or just build for production), and use a '&::placeholder' selector.

Reproduction in codesandbox: https://codesandbox.io/s/emotion-forked-d29s1?file=/index.js

Expected behavior:

It seems that Chrome is just not going to be happy with the auto-prefixing behavior when using the insertRule() API. May need to do some basic browser detection to not insert the ::-moz-placeholder and ::-ms-input-placeholder rules when on Chrome/Safari.

It's possible that this is an issue in other browsers as well.

Environment information:

  • @emotion/css version: 11.0.0
  • Chrome: 87
  • Safari 13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions