Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enterkeyhint attribute is filtered by is-prop-valid #2530

Closed
fabb opened this issue Oct 29, 2021 · 4 comments · Fixed by #2540
Closed

enterkeyhint attribute is filtered by is-prop-valid #2530

fabb opened this issue Oct 29, 2021 · 4 comments · Fixed by #2540

Comments

@fabb
Copy link
Contributor

fabb commented Oct 29, 2021

Current behavior:

enterKeyHint is a new attribute for input elements. Currently it is being filtered by is-prop-valid and cannot be set on the dom element without a workaround.

const Input = styled.input``

const App = () => (
    <Input enterKeyHint="next" />
)

See styled-components/styled-components#3417

To reproduce:

See styled-components/styled-components#3417

Environment information:

  • react version: 17
  • @emotion/react version: n/a, using styled-components which itself uses @emotion/is-prop-valid
@Andarist
Copy link
Member

Fixing this is quite easy - just add this to the allowlist here: https://github.com/emotion-js/emotion/blob/4be3391914878fd41279701bc23332b75903ec43/packages/is-prop-valid/src/props.js

Would you like to prepare such a change?

@fabb
Copy link
Contributor Author

fabb commented Nov 2, 2021

Sure, why not. I’ll also check if there are others missing as well: https://github.com/facebook/react/blob/main/packages/react-dom/src/shared/possibleStandardNames.js

@fabb
Copy link
Contributor Author

fabb commented Nov 3, 2021

ok i compared the possibleStandardNames.js with the props.js and found that these were missing:

  • enterKeyHint
  • disableRemotePlayback
  • icon
  • noModule

it looks like disableRemotePlayback and icon are properties but no html element attributes, so i think they can be ignored. noModule is just used on script tags, so it should be irrelevant for css styling. i'll create a PR with just enterKeyHint.

fabb added a commit to fabb/emotion that referenced this issue Nov 3, 2021
@fabb
Copy link
Contributor Author

fabb commented Nov 3, 2021

created PR: #2540

Andarist added a commit that referenced this issue Nov 14, 2021
* allow enterKeyHint attribute to be set

fixes #2530

* Create silver-fireants-jump.md

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants