Skip to content

ColorPicker's color field doesn't commit its value if the popover is dismissed via outside click #9748

@LFDanLu

Description

@LFDanLu

Provide a general summary of the issue here

Reported via slack, user flow is as follows

  1. Open ColorPicker
  2. Modify the color field via keyboard input (e.g. 111111 or some other fully defined value
  3. Click outside the ColorPicker's popover and note that the color change has not been saved

This is because React doesn't call blur on unmount, and ColorField only commit's its value on blur. Can be reproduced via https://react-spectrum.adobe.com/v3/ColorPicker.html.

This is causing confusion for end users since they don't know that they have to blur from the ColorField for it to commit the typed color change

🤔 Expected Behavior?

Ideally the color change would be committed when the popover is closed via click

😯 Current Behavior

keyboard inputted color change is not committed when the popover is closed via click

💁 Possible Solution

Perhaps the ColorField should commit if it receives a fully defined value? Or maybe we have ColorPicker commit on popover unmount?

🔦 Context

No response

🖥️ Steps to Reproduce

  1. navigate to https://react-spectrum.adobe.com/v3/ColorPicker.html and open the popover for the ColorPicker
  2. modify the color field to 111111
  3. click outside the popover, note that the color hasn't changed

Version

3.35

What browsers are you seeing the problem on?

Other

If other, please specify.

All

What operating system are you using?

MacOS

🧢 Your Company/Team

Marketo

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

Type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions