cal.com icon indicating copy to clipboard operation
cal.com copied to clipboard

fix: add proper disabled-state styling to Select component

Open eeshm opened this issue 3 weeks ago • 2 comments

What does this PR do?

Problem

  • The Select component did not visually indicate its disabled state, causing inconsistency with TextField.

Solution

  • Applied proper disabled-state styling using state.isDisabled (the correct react-select API source of truth)

  • Added !cursor-not-allowed to visually signal that the component is non-interactive.

  • Added !pointer-events-none to prevent any interaction when the component is disabled.

  • Fixes #25708

  • Fixes CAL-6883

Visual Demo

before:

https://github.com/user-attachments/assets/07b6e8ba-2c74-4112-94e6-93ae1dfbccfa

after:

https://github.com/user-attachments/assets/7b56ae66-7f69-48d0-89eb-cc1e3de8967a

Mandatory Tasks (DO NOT REMOVE)

  • [x] I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • [x] I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A
  • [x] I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Use any UI component that renders a SelectField with isDisabled={true}.

Expected behavior:

  • Hovering should show cursor-not-allowed.
  • Component should not respond to pointer events.
  • Confirm behavior across themes (light/dark) and states (focus, hover).
  • Verify that react-select's internal state.isDisabled is correctly reflected in the rendered component.

eeshm avatar Dec 08 '25 09:12 eeshm

@eeshm is attempting to deploy a commit to the cal Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Dec 08 '25 09:12 vercel[bot]

thanks for the feedback! made changes

  • Created and linked the issue describing the missing disabled cursor/icon behavior.
  • Added hover:border-subtle to match the disabled TextField UI and ensure consistent visual behavior.
  • pointer-events-auto is needed because React-Select’s default pointer-events:none hides the browser’s native red invalid icon. Restoring pointer events brings back the validation UI without re-enabling interaction, since React-Select already blocks interaction through other internal mechanisms.

https://github.com/user-attachments/assets/3b3db8b9-d8ef-47c8-9343-8d62a7394e54

Please let me know if you'd like any further adjustments!

eeshm avatar Dec 08 '25 14:12 eeshm

E2E results are ready!

github-actions[bot] avatar Dec 18 '25 17:12 github-actions[bot]