multiselect-web-component icon indicating copy to clipboard operation
multiselect-web-component copied to clipboard

Fix a bug where if the contents change then it didnt update the UI

Open PhilAndrew opened this issue 7 years ago • 1 comments

This pull request solves this problem.

You should use a MutationObserver https://developer.mozilla.org/en/docs/Web/API/MutationObserver

If the contents of the web component changes, for example the

        <li value="1" selected>Item 1</li>
        <li value="2">Item 2</li>
        <li value="3" selected>Item 3</li>
        <li value="4">Item 4</li>

If I used Javascript to change the contents of this to

        <li value="1" selected>Item 1</li>
        <li value="2">Item 2</li>

Then it should update the displayed data again. So if I use javascript to change the contents then it should update again.

PhilAndrew avatar May 21 '17 09:05 PhilAndrew

@PhilAndrew, thank you for the contribution! Could you please address a couple of comments?

tabalinas avatar May 29 '17 13:05 tabalinas