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

input elements don't get key from props #529

Closed
callum-oakley opened this issue Feb 10, 2021 · 0 comments
Closed

input elements don't get key from props #529

callum-oakley opened this issue Feb 10, 2021 · 0 comments
Labels

Comments

@callum-oakley
Copy link

callum-oakley commented Feb 10, 2021

Most elements let you provide a :key either in metadata or in the props, but providing a :key to an :input element in props doesn't appear to work. I haven't looked at the code very deeply, but something to do with the special casing for :input and :textarea? For example, on v1.0.0:

(.-key (r/as-element           [:input {:key 0}])) ;=> nil
(.-key (r/as-element ^{:key 0} [:input]))          ;=> "0"
(.-key (r/as-element           [:div   {:key 0}])) ;=> "0"
(.-key (r/as-element ^{:key 0} [:div]))            ;=> "0"

Obviously not a showstopper since I can just use metadata instead. :)

@Deraen Deraen added the bug label Feb 12, 2021
@Deraen Deraen closed this as completed in 19e7205 Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants