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

"phx-disable-with" disables button completely #2993

Closed
PJUllrich opened this issue Jan 9, 2024 · 2 comments · Fixed by #3009
Closed

"phx-disable-with" disables button completely #2993

PJUllrich opened this issue Jan 9, 2024 · 2 comments · Fixed by #3009
Assignees
Labels

Comments

@PJUllrich
Copy link

PJUllrich commented Jan 9, 2024

Environment

  • Elixir version (elixir -v): 1.15.7
  • Phoenix version (mix deps): 1.17.10
  • Phoenix LiveView version (mix deps): 0.20.1
  • Operating system: macOS Sonoma
  • Browsers you attempted to reproduce this bug on (the more the merrier): Arc (Chrome)
  • Does the problem persist after removing "assets/node_modules" and trying again? Yes/no: Yes

Actual behavior

When I set the phx-disable-with flag on a button and click the button, the button doesn't re-enable after the server sent the response.

Usually, the button would be disabled right after I clicked it and while the server processes the event, but then re-enable after the server responds to the event and the browser received the response. However, if I set the phx-disable-with parameter, the button stays disabled and I need to reload the page to fix it.

Here's a demo. The HTML Button has no phx-disable-with set and works as expected. The other two buttons have phx-disable-with and stay disabled. I also tested whether this is a LiveView vs LiveComponent or "HTML Button" vs CoreComponent button issue, but this doesn't seem to make a difference.

CleanShot 2024-01-09 at 11 04 27

I created an example repo that replicates this issue here: https://github.com/PJUllrich/button

Expected behavior

The button should re-enable after the server sent a response.

@PJUllrich PJUllrich changed the title "phx-disable-with" disabled button completely "phx-disable-with" disables button completely Jan 9, 2024
@chrismccord chrismccord self-assigned this Jan 9, 2024
@chrismccord
Copy link
Member

This only happens when the server sends no diff. I will take a look. Thanks!

@PJUllrich
Copy link
Author

Thank you @chrismccord May I ask when you plan on releasing the new version with the bugfix on Hex?

SteffenDE added a commit to SteffenDE/phoenix_live_view that referenced this issue Jan 14, 2024
chrismccord pushed a commit that referenced this issue Jan 15, 2024
SteffenDE added a commit to SteffenDE/phoenix_live_view that referenced this issue Jan 15, 2024
SteffenDE added a commit to SteffenDE/phoenix_live_view that referenced this issue Jan 15, 2024
SteffenDE added a commit to SteffenDE/phoenix_live_view that referenced this issue Jan 15, 2024
chrismccord pushed a commit that referenced this issue Jan 17, 2024
playwright e2e tests


references #3009
references #2993
references #1759

* build assets in e2e pipeline

We want to run the e2e tests with the latest assets without the need to
commit them to the repository. Otherwise we would not see test
failures from changes to the js code as early as possible.
chrismccord pushed a commit that referenced this issue Jan 17, 2024
chrismccord pushed a commit that referenced this issue Jan 17, 2024
playwright e2e tests


references #3009
references #2993
references #1759

* build assets in e2e pipeline

We want to run the e2e tests with the latest assets without the need to
commit them to the repository. Otherwise we would not see test
failures from changes to the js code as early as possible.
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.

2 participants