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

Feature/react select autocomplete off #144

Merged
merged 10 commits into from
Dec 29, 2020

Conversation

jvorcak
Copy link
Contributor

@jvorcak jvorcak commented Dec 28, 2020

I admit this is not very elegant, but it works. Instead of using currently hard-coded value off, we hard-code it to chrome-off which really disables it in all browsers.

Any other suggestions are welcome.

Do you have any other use-cases where we would actually need to provide a value for this component?

Problem with a current implementation:
Screenshot 2020-12-28 at 12 00 36

Related issue: JedWatson/react-select#3500

@jvorcak jvorcak changed the title Feature/react select autocomplete off WIP: Feature/react select autocomplete off Dec 28, 2020
@jvorcak jvorcak force-pushed the feature/react-select-autocomplete-off branch from 78a610b to 5bb4d1b Compare December 28, 2020 11:14
@jvorcak jvorcak changed the title WIP: Feature/react select autocomplete off Feature/react select autocomplete off Dec 28, 2020
const Input = (props: any) => {
// autoComplete='off' is hard-coded inside SelectField, but doesn't work in Chrome.
// Having an invalid value hard-coded disabled it in all browsers.
return <components.Input {...props} autoComplete="one-time-code" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not chrome-off?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aigoncharov I couldn't decide whether it's better to use an invalid a11y value or a value that shouldn't in practice effect functionality. I was 50/50, now I'm thinking an explicit chrome-off could be better, even though it's invalid.

@jvorcak
Copy link
Contributor Author

jvorcak commented Dec 29, 2020

If it's ok with you I'll merge and fix #145 afterward, I'm quite limited on time right now.

@jvorcak jvorcak merged commit dd0c4a9 into master Dec 29, 2020
@jvorcak jvorcak deleted the feature/react-select-autocomplete-off branch December 29, 2020 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants