Skip to content

Commit

Permalink
fix: Colorpicker empty color value regression (#36157)
Browse files Browse the repository at this point in the history
/ok-to-test tags="@tag.All"

This PR fixes a regression that was added by #36119

<!-- This is an auto-generated comment: Cypress test results  -->
> [!CAUTION]
> 🔴 🔴 🔴 Some tests have failed.
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/10736250400>
> Commit: 11ba202
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=10736250400&attempt=1&selectiontype=test&testsstatus=failed&specsstatus=fail"
target="_blank">Cypress dashboard</a>.
> Tags: @tag.All
> Spec: 
> The following are new failures, please fix them before merging the PR:
<ol>
>
<li>cypress/e2e/Regression/ServerSide/OnLoadTests/ExecuteAction_Spec.ts</ol>
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master"
target="_blank">List of identified flaky tests</a>.
> <hr>Fri, 06 Sep 2024 11:05:42 UTC
<!-- end of auto-generated comment: Cypress test results  -->


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Improved color input handling to ensure that empty values are
processed correctly, enhancing color validation functionality.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Pawan Kumar <[email protected]>
  • Loading branch information
jsartisan and Pawan Kumar authored Sep 6, 2024
1 parent 08ec688 commit c47de98
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,7 @@ const ColorPickerComponent = React.forwardRef(

const handleChangeColor = useCallback(
(event: React.ChangeEvent<HTMLInputElement>) => {
const value = event.target.value;

if (!value) return;
const value = event.target.value || "";

if (isValidColor(value)) {
debouncedOnChange(value, true);
Expand Down

0 comments on commit c47de98

Please sign in to comment.