Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

Merge into yj-focus-formfield - Don't use keycodes#328

Merged
pmespresso merged 4 commits intoyj-focus-formfieldfrom
am-focus-formfield
Jan 2, 2019
Merged

Merge into yj-focus-formfield - Don't use keycodes#328
pmespresso merged 4 commits intoyj-focus-formfieldfrom
am-focus-formfield

Conversation

@amaury1093
Copy link
Collaborator

@amaury1093 amaury1093 commented Jan 2, 2019

@yjkimjunior Can we try and use the onSubmit prop on a <form>? I proposed here just one example on AccountName, but I think the same thing could work everywhere. I.e. don't add onSubmit on fields, but on the wrapping form. We could delete all usage of event.keycode too.

To be merged into #323

@pmespresso
Copy link
Contributor

Hi @amaurymartiny, I agree it is hacky but I resorted to it because the enter key press behavior maps to the back button even while the input is in focus. This happens whenever the back button is present, i.e. when currentStep > 1. In a previous commit this behavior persisted even after explicitly calling blur() on the back button as well. So far what I could come up with has been to use the keycodes or to outright disable the back button...

@amaury1093
Copy link
Collaborator Author

amaury1093 commented Jan 2, 2019

hmm, I'm still reluctant to merge keycodes in, I prefer to know the root of the pb why the back button always has focus, then to add hacks and workarounds. Have you tried this PR? It works on my machine, on the AccountName page the enter key goes to the next page.

Also, maybe tabindex=-1 on the back button might work?

@pmespresso
Copy link
Contributor

yup, I tried pulling your change and it works on AccountName which is currentStep === 1 however it has the same problem behavior if I just manually set back button enabled on that page though. Just tried setting tabIndex=-1 on the back button to same behavior. Also tried setting tabIndex=1 to the next button which causes a page reload and doesn't hit the onSubmit handler. 😞

@amaury1093
Copy link
Collaborator Author

@yjkimjunior can you try again now?

@pmespresso pmespresso merged commit 4e719fb into yj-focus-formfield Jan 2, 2019
@amaury1093 amaury1093 deleted the am-focus-formfield branch January 2, 2019 18:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants