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

Changing empty placeholder on MaterialListValueBox does not work correctly #1007

Open
chemmett opened this issue May 28, 2021 · 0 comments
Open

Comments

@chemmett
Copy link

If you call setEmptyPlaceHolder() on a MaterialListValueBox that has an existing placeholder, it inserts another placeholder at index 0 instead of just changing the text. If you change it when the list is empty, you end up with multiple placeholders, if you change it when there are already values in the list, the side effects are worse: it changes the indexing and the selected value does not equal the visually selected item.

Our use case was we wanted the placeholder to say something like "loading..." initially and then change it to "Select Foo" when the list populated after an ajax call.

Instead of always calling insertEmptyPlaceHolder(value), it should check if the placeholder is listed and if so, just change the text.
emptyplaceholder.txt

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

1 participant