-
Notifications
You must be signed in to change notification settings - Fork 618
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
use data-custom-properties #982
Comments
I can duplicate this issue. It looks like it is a regression and will need to be fixed. Also, you may want to use events provided by Choices instead of adding an event listener directly to the <select id="choicesTest">
<option value="Test1" data-custom-properties="test">Test1</option>
<option value="Test2" data-custom-properties="test">Test2</option>
<option value="Test3" data-custom-properties="test">Test3</option>
</select> const choicesTest = new Choices(document.getElementById('choicesTest'));
choicesTest.passedElement.element.addEventListener('change', (event) => {
console.log(event.currentTarget.selectedOptions[0].dataset.customProperties);
}); |
in code:
from original html code properties not passed. i need get properties stanalone. in my code i init Choices.js to all select on project. and in same time i need on page get properties on change. |
if after init choices i use .desctroy() - all data-custom-properties lost on select element |
hi, i have html select
i try get data-custom-properties after change
and show_droplist have data-custom-properties:
value: "[object Object]"
how get data attr from change options?
The text was updated successfully, but these errors were encountered: