Merge into yj-focus-formfield - Don't use keycodes#328
Merge into yj-focus-formfield - Don't use keycodes#328pmespresso merged 4 commits intoyj-focus-formfieldfrom
Conversation
|
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... |
|
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? |
|
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. 😞 |
|
@yjkimjunior can you try again now? |
@yjkimjunior Can we try and use the
onSubmitprop 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