Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable timepicker-knapper når feltet er disablet #657

Merged
merged 1 commit into from
Mar 13, 2023

Conversation

selbekk
Copy link
Contributor

@selbekk selbekk commented Mar 13, 2023

Bakgrunn

Det gikk an å tabbe seg inn til "bakover" og "fremover" knappene i et disabled Timepicker felt.

Løsning

Sett isDisabled-propen på disse knappene. Overstyr bakgrunnsfargen til disse knappene, så de ikke får den grå bakgrunnsfargen man får med ghost-knapper.

@selbekk selbekk requested a review from johnolos March 13, 2023 14:12
@changeset-bot
Copy link

changeset-bot bot commented Mar 13, 2023

🦋 Changeset detected

Latest commit: cda2e01

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@vygruppen/spor-datepicker-react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -144,6 +144,8 @@ export const TimePicker = ({
title={backwardsLabel}
icon={<DropdownLeftFill24Icon />}
onClick={handleBackwardsClick}
isDisabled={isDisabled}
style={isDisabled ? { backgroundColor: "transparent" } : {}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disablede ghost-knapper har en grå bakgrunn for å vise at de er disabled. Det vil vi veldig spesifikt overstyre i dette tilfellet.

Det fungerte ikke å gjøre det med backgroundColor="transparent", fordi det blir overstyrt av en selector i ChakraUI.

@selbekk selbekk merged commit 9208b78 into main Mar 13, 2023
@selbekk selbekk deleted the fix-focusable-disabled-timepicker branch March 13, 2023 14:13
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.

1 participant