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

Replace datalist children instead of appending #3682

Merged
merged 2 commits into from Jan 31, 2023

Conversation

jasongrout
Copy link
Member

@jasongrout jasongrout commented Jan 28, 2023

This replaces datalist children when the options are updated rather than appending them.

I also added a test that shows the problem by failing with the current code and passing with the new code.

Fixes #3681

@paoloalba
Copy link

I tried to patch the js files myself without success. Is there some documentation on how to do that? I could definitively wait for the next release, but now I am just curious to know how to do it!

@ibdafna ibdafna merged commit 6547f84 into jupyter-widgets:main Jan 31, 2023
@@ -671,7 +671,7 @@ export class ComboboxView extends TextView {
o.value = v;
optionFragment.appendChild(o);
}
this.datalist.appendChild(optionFragment);
this.datalist.replaceChildren(...optionFragment.children);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it not be faster (and more consistent) with this.datalist.replaceChildren(optionFragment) ?

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

Successfully merging this pull request may close these issues.

Combobox options in cascade update
4 participants