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

Refactor button disabling with Stimulus value attribute #440

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

kirillplatonov
Copy link
Collaborator

Value attributes are more reliable when button state changed by external Stimulus controller.

@kirillplatonov kirillplatonov merged commit 438d6c3 into main Aug 26, 2024
4 checks passed
@kirillplatonov kirillplatonov deleted the refactor-button-disabling branch August 26, 2024 19:16
@hoppergee
Copy link

Hi @kirillplatonov

I came from the v2.2.2 release note and found the functionality of the disable/enable function seems to have become a purely UI change after this PR. Does this mean that users need to manually change the button's disabled state, rather than continuing to rely on the function in the button controller after this release?

@kirillplatonov
Copy link
Collaborator Author

The functionality should be the same. When the button is disabled we ignoring future clicks until it's enabled again: /~https://github.com/baoagency/polaris_view_components/blob/main/app/assets/javascripts/polaris_view_components/button_controller.js#L8

I updated preview for this feature to better demonstrate how it works. If it's not working for you then it's probably a bug.
https://polarisviewcomponents.org/lookbook/inspect/button/disable_with_actions

Changes in this PR must only improve the internal implementation to better work with external controller (eg when button state is managed by form controller and synchronized with App Bridge save bar).

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.

2 participants