Skip to content

fix(color-picker): guard edits when the input is disabled - #4417

Open
Xapollon430 wants to merge 1 commit into
framework7io:masterfrom
Xapollon430:codex/guard-disabled-color-picker-input
Open

Xapollon430 wants to merge 1 commit into
framework7io:masterfrom
Xapollon430:codex/guard-disabled-color-picker-input

Conversation

@Xapollon430

Copy link
Copy Markdown

Problem

The color picker stays interactive when its attached input becomes disabled while the popover is open. A palette click or a continued drag can still change the color and emit change.

Fixes #4415.

Reproduction

Open a color picker set to red. Disable its input while the popover is open and click the blue swatch. The input changes to blue. Reproduction video

Fix

Route user edits from the built-in color picker modules through a disabled-state check before calling setValue().

Verification

In Chrome, both a palette click and a spectrum drag that was in progress at disable changed the value before the patch. Both preserved the current color and emitted no change after it. Programmatic setValue() still worked while disabled, and the palette worked after re-enabling. The changed files passed Prettier.

This branch has not been deployed

No deployments
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.

Color Picker still accepts a color after its input becomes disabled

1 participant