A swap-in replacement for 🏁 React Final Form's <Field> component to provide HTML5 Validation
MIT License
56
stars
8
forks
source link
Failed to execute 'querySelector' on 'Element': 'input[name=company.country],textarea[name=company.country],select[name=company.country]' is not a valid selector. #7
Are you submitting a bug report or a feature request?
Feature Request
What is the current behavior?
The current version is not supporting Field with Object.Key pattern name which is supported by react-final-form's Field component.
When such a name pattern is used it creates an incorrect node selector i.e 'input[name=company.country]'.
What is the expected behavior?
Field Component should support object.key naming pattern.
Sandbox Link
What's your environment?
final-form v4.8.3
react-final-form v3.6.5
react-final-form-html5-validation v1.0.1
Node v8.9
npm v6.3
Other information
Solution which i have found.
This issue can be fixed by surrounding the name with quotes.
input = root.querySelector(input[name="${name}"],textarea[name="${name}"],select[name="${name}"]);
Are you submitting a bug report or a feature request?
What is the current behavior?
What is the expected behavior?
Sandbox Link
What's your environment?
Other information
Solution which i have found.
input[name="${name}"],textarea[name="${name}"],select[name="${name}"]
);