-
Notifications
You must be signed in to change notification settings - Fork 50
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
ChosenValueListBox allowSingleDeselect not working as expected #285
Comments
Are you using version 3.0.1 that we just released? |
No, we had the problem on version 3.0 and I switched to 3.1-SNAPSHOT to see if the problem has been solved. You think it's worth a try with 3.0.1 anyway? |
No, they are the same at the moment. Can you post your Renderer's code? FYI, the dev-site samples are using version 3.1-SNAPSHOT |
Here it is:
|
Just to be sure, what is not working exactly? I'm not sure what's the issue and what is not working as expected |
Ok. I try to explain it again in other words: Here is the declaration of my chosen box with custom filtering:
The Renderer returns "" for a null object. This is the relevant extract from personSearchProvider which implements ResultsFilter:
As you can see, a null item is inserted at position 0. I would expect:
|
What browser/version are you using? Can you confirm the you can select and deselect elements in the samples? |
I'm using Chrome Version 46. And yes, I confirm that the sample under "allowSingleDeselect" is working. Also the other examples do work well. |
Sorry, I meant this page : http://dev.arcbees.com/gwtchosen/widgetsample/, but the ChostValueListBox sample doesn't have a placeholder. It's still unclear to me what's wrong on your side |
I've done a simple test and it's working as expected. setting allowSingleDeselect to true and having null as first acceptable values allows to deselect an element |
Thank you |
Sorry, do you have any news on this? Thank you |
Without a more complete code example, it'll be hard for us to give more feedback. We tried to reproduce your issue but were unable to.. |
I made a fork and could reproduce the issue. These are the changes: schragmanuel@19087ad Can you please try again and give me a feedback? Thank you |
Thanks for the complete example. I'll try to look at this soon |
Why aren't I on there |
Fix for #285 : ChosenValueListBox allowSingleDeselect not working as expected
Fellows, getting same problem with 3.0.. Please say where you've merged it and in what version this bug is gone. Thank you! |
I use ChosenValueListBox to dynamically fill a ListBox with Objects at runtime (setAcceptableValues). When i set the option setAllowSingleDeselect(true), I expect the little cross icon to appear as mentioned in the allowSingleDeselect example on http://dev.arcbees.com/gwtchosen/. Of course, I set the first element in the acceptable values to null, because this is needed as stated in the docs and the line of Code in ChosenImpl:
I managed to work around this issue by setting a list with a null value on creation of the ChosenValueListBox. But this only works for the first time the box is attached to the DOM. When I switch between Views, which are singletons, the cross disappears.
No idea if it's related, but when debugging I can see that after a setAcceptableValues() with a null Element, the empty Element first appears in the DOM, but after the method updateChosenListBox() it's gone.
The text was updated successfully, but these errors were encountered: