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

Disabled Button is not clickable after being enabled #480

Closed
StorytellerCZ opened this issue Nov 7, 2019 · 7 comments · Fixed by #481
Closed

Disabled Button is not clickable after being enabled #480

StorytellerCZ opened this issue Nov 7, 2019 · 7 comments · Fixed by #481
Labels

Comments

@StorytellerCZ
Copy link

StorytellerCZ commented Nov 7, 2019

🐛 Bug report

Current behavior

When having a Button with type="submit" in a form renders the form unsubmitable. Can't trigger the submit action from input fields nor clicking at the submit button.

Steps to reproduce the bug

  1. Open sandbox: https://codesandbox.io/s/stoic-poitras-1f4or
  2. Write something and try to click the button (or hit enter in the input field), nothing happens.
  3. Change Reakit button to standard button in the code.
  4. Click the button and you will see your input in the console.
  5. Change the version of Reakit version to 1.0.0-beta.9 and use Reakit Button again and the form will work correctly.

Expected behavior

Button with input type="submit" should submit the form it is part of.

Possible solutions

Not really sure. Just noticed this today (2019-11-07) after upgrading to beta.10 (from beta.9). The only suspicious thing I can find in the changelog is #474, but that looks pretty innocent to me.

Environment

$ npx envinfo --system --binaries --browsers --npmPackages "{react*,reakit*}"

System:
    OS: Linux 5.3 Ubuntu 19.10 (Eoan Ermine)
    CPU: (4) x64 Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
    Memory: 4.49 GB / 15.55 GB
    Container: Yes
    Shell: 5.0.3 - /bin/bash
  Binaries:
    Node: 12.11.1 - /usr/bin/node
    Yarn: 1.19.1 - /usr/bin/yarn
    npm: 6.12.1 - /usr/bin/npm
  Browsers:
    Chrome: 73.0.3683.103
    Firefox: 70.0.1
  npmPackages:
    react: ^16.11.0 => 16.11.0 
    react-accessible-accordion: ^3.0.0 => 3.0.0 
    react-apollo: ^3.1.3 => 3.1.3 
    react-dom: ^16.11.0 => 16.11.0 
    react-final-form: ^6.3.0 => 6.3.0 
    react-final-form-arrays: ^3.1.1 => 3.1.1 
    react-final-form-listeners: ^1.0.2 => 1.0.2 
    react-helmet: ^5.2.1 => 5.2.1 
    react-intl: ^3.4.0 => 3.4.0 
    react-loading: ^2.0.3 => 2.0.3 
    react-portal: ^4.2.0 => 4.2.0 
    react-router-dom: ^5.1.2 => 5.1.2 
    react-select: ^3.0.8 => 3.0.8 
    reakit: ^1.0.0-beta.10 => 1.0.0-beta.10 
@open-collective-bot
Copy link

Hey @StorytellerCZ 👋,

Thank you for opening an issue. We'll get back to you as soon as we can.
Please, consider supporting us on Open Collective. We give a special attention to issues opened by backers.

If you use Reakit at work, you can also ask your company to sponsor us ❤️.

@StorytellerCZ StorytellerCZ changed the title Button type submit can't be trigggered Button type submit prevents form submitting Nov 7, 2019
@tom-sherman
Copy link
Member

tom-sherman commented Nov 7, 2019

This seems to be an issue with using the render prop of react-final-form in combination with a Reakit submit button. When using a native form element, Reakit beta 10 works as expected: https://codesandbox.io/s/withered-dust-uf08c

@diegohaz diegohaz added the bug label Nov 7, 2019
@diegohaz
Copy link
Member

diegohaz commented Nov 7, 2019

It's indeed a bug. Working on a fix.

We can reproduce it by rendering a disabled button in the first render and then removing the disabled prop later.

@diegohaz diegohaz changed the title Button type submit prevents form submitting Disabled button is not clickable after being enabled Nov 7, 2019
@diegohaz diegohaz changed the title Disabled button is not clickable after being enabled Disabled Button is not clickable after being enabled Nov 7, 2019
@StorytellerCZ
Copy link
Author

Thanks for the fix! I found it at 1 in the morning so sorry for the report not being a better quality.
Any chance that this could be released soon?

@diegohaz
Copy link
Member

diegohaz commented Nov 8, 2019

No worries! Thanks for reporting it! I'll cut a release today or tomorrow at the most.
By the way, thanks for the donation! ❤️

@StorytellerCZ
Copy link
Author

Thanks! I'm in a pitch, because if I go back to beta.9 I run into another error in my app that has been fixed in beta.10. 😅
I wish I could donate more and regularly, but sadly I have been burning through my savings for a while.

@diegohaz
Copy link
Member

diegohaz commented Nov 8, 2019

It's been released as v1.0.0-beta.11!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants