Why no reliable callback of opening the date selector? #1122
-
I need to fire something each time someone clicks on the input. So I tried with:
They all fire when the page loads and never when I click on the input. The date selector with the two months shown, but nothing gets fired. This is the current implementation:
Am I doing something wrong, or this component really doesn't have such callback :( PS: Those callbacks fire whenever I choose some date, but I don't want this. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Finally I ended with remembering the dates and whenever the user changes dates - I'm comparing with the old ones and if there is change - I'm doing the necessary stuff. In other words - now I do things when the dates has changed and not when the calendar opens. Not perfect, but works fine :) |
Beta Was this translation helpful? Give feedback.
-
@peshoicov They are firing when the page loads since you are executing them. |
Beta Was this translation helpful? Give feedback.
-
If someone is facing the same issue, you can achieve it by doing this.
@gpbl , @peshoicov You may close this issue. |
Beta Was this translation helpful? Give feedback.
@peshoicov They are firing when the page loads since you are executing them.
It should be
onClick={() => console.log('CLICK')}
instead of
onClick={console.log('CLICK')}