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

Error when unselecting last month #60

Open
Benraay opened this issue Oct 20, 2020 · 2 comments
Open

Error when unselecting last month #60

Benraay opened this issue Oct 20, 2020 · 2 comments

Comments

@Benraay
Copy link

Benraay commented Oct 20, 2020

there is no way to have an empty value in the month picker, tried on demo page the whole page is crashing when we unselect the selected month, we should be able to put a null or empty value and show "pick a month" default placeholder.

@nickeljew
Copy link
Owner

I actually did not take into consideration the way to set null or empty value on the picker panel. But for now, you may try to offer the option to "clear" the selection in your pick box.
The pick box element is not an embedded part of the picker component, so you can do whatever you want to make your pick box.

@Aghamyr
Copy link

Aghamyr commented Oct 20, 2020

Hi, that's also the solution I chose, giving a null value to the input displaying the currently selected date, so it looks like there is none selected.
But it would be nice to be able to pass null to the Picker component, because currently when opening the Picker after "clearing" the selection the picker will still show a month as selected while it shouldn't, and it could confuse the end user.

Edit: forgot to mention but currently is you unselect all the selected options in a picker(that allows multiple select), it will completely crash react as it throw and error with the map (the error comes from the demo site)

Uncaught TypeError: Cannot read property 'map' of null
    at List.render (demo.jsx:462)
    at finishClassComponent (react-dom.development.js:17295)
    at updateClassComponent (react-dom.development.js:17245)
    at beginWork (react-dom.development.js:18755)
    at HTMLUnknownElement.callCallback (react-dom.development.js:182)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:231)
    at invokeGuardedCallback (react-dom.development.js:286)
    at beginWork$1 (react-dom.development.js:23338)
    at performUnitOfWork (react-dom.development.js:22289)
    at workLoopSync (react-dom.development.js:22265)
```

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

No branches or pull requests

3 participants