aboveyunhai / chakra-dayzed-datepicker

Chakra UI + Dayzed = datepicker
https://aboveyunhai.github.io/chakra-dayzed-datepicker/
MIT License
222 stars 46 forks source link

using `minDate`, date button do not have disabled style #40

Closed jeromevvb closed 1 year ago

jeromevvb commented 1 year ago

Hi everyone, I have set a minDate : Tue Feb 28 2023 , days before minDate are not active but do not have any disabled styles. I've tried to force it myself with the propsConfigs but it does not work.

Buttons keep whiteColor

Screenshot 2023-01-29 at 2 23 12 PM
propsConfigs={{
                inputProps: { size: 'lg' },
                dayOfMonthBtnProps: {
                  defaultBtnProps: {
                    _hover: {
                      background: 'primary.500'
                    },
                    _disabled: {
                      opacity: 0.4,
                    }
                  },
                  selectedBtnProps: {
                    color: 'white',
                    bgColor: 'primary.500'
                  }
                }
              }}

Any ideas?Thank you Version: chakra-ui/react: ^2.4.7 chakra-dayzed-datepicker: ^0.2.6

jeromevvb commented 1 year ago

https://github.com/aboveyunhai/chakra-dayzed-datepicker/blob/main/src/components/dayOfMonth.tsx#L87

i'm presuming this should be isDisabled instead of disabled according to the Button docs

aboveyunhai commented 1 year ago

https://github.com/aboveyunhai/chakra-dayzed-datepicker/blob/main/src/components/dayOfMonth.tsx#L87

i'm presuming this should be isDisabled instead of disabled according to the Button docs

You are right, the disabled existed before v2, and it seems like it was removed in v2 at some point.

I have no idea why the decision was made since the html attr is disabled. 😕, maybe I should cover both.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-disabled

Edit: that change happened roughly 2-3 weeks ago.

aboveyunhai commented 1 year ago

npm@0.2.7 is out. @jeromevvb let me know id the issue still persists

jeromevvb commented 1 year ago

@aboveyunhai works perfectly, great job!