Skip to content

fix: respect disabled parent when syncing client disabled state (#10023) (CP: 25.3) - #10026

Merged
web-padawan merged 1 commit into
25.3from
cherry-pick-10023-to-25.3-1788530824437
Sep 4, 2026
Merged

fix: respect disabled parent when syncing client disabled state (#10023) (CP: 25.3)#10026
web-padawan merged 1 commit into
25.3from
cherry-pick-10023-to-25.3-1788530824437

Conversation

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This PR cherry-picks changes from the original PR #10023 to branch 25.3.

Original PR description

Description

DisableOnClickController forces the client-side disabled property from setEnabled, because Flow does not send a change when a component is disabled and re-enabled in the same round trip. It used the value passed to setEnabled, so enabling a button under a disabled parent cleared disabled on the client while the server kept rejecting clicks.

  • Changed DisableOnClickController.onSetEnabled() to schedule the client update with beforeClientResponse and read the effective enabled state at that point, so a disabled parent keeps the component disabled on the client
  • Coalesced repeated setEnabled calls in one round trip into a single client update
  • Deferred the update until the component is attached instead of queueing a JavaScript call per setEnabled call while detached
  • Removed the unused enabled parameter from onSetEnabled() and updated Button and MenuItemBase
  • Added unit tests for the disabled parent, same round trip, and detached cases

Type of change

  • Bugfix

## Description

`DisableOnClickController` forces the client-side `disabled` property
from `setEnabled`, because Flow does not send a change when a component
is disabled and re-enabled in the same round trip. It used the value
passed to `setEnabled`, so enabling a button under a disabled parent
cleared `disabled` on the client while the server kept rejecting clicks.

- Changed `DisableOnClickController.onSetEnabled()` to schedule the
client update with `beforeClientResponse` and read the effective enabled
state at that point, so a disabled parent keeps the component disabled
on the client
- Coalesced repeated `setEnabled` calls in one round trip into a single
client update
- Deferred the update until the component is attached instead of
queueing a JavaScript call per `setEnabled` call while detached
- Removed the unused `enabled` parameter from `onSetEnabled()` and
updated `Button` and `MenuItemBase`
- Added unit tests for the disabled parent, same round trip, and
detached cases

## Type of change

- Bugfix

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Sep 4, 2026

Copy link
Copy Markdown

@web-padawan
web-padawan merged commit 22fa7c9 into 25.3 Sep 4, 2026
26 checks passed
@web-padawan
web-padawan deleted the cherry-pick-10023-to-25.3-1788530824437 branch September 4, 2026 14:20
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.

3 participants