We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For some reason the visible index is always the same as the index on the data coming from labelRenderer and sampleLabelRenderer.
data
labelRenderer
sampleLabelRenderer
Shouldn't one of those values reflect the value of the dropdown item on the DOM?
Demo here (Scroll until the last item on the list) https://jsfiddle.net/1be6ps5g/
Code for reproduction:
VirtualSelect.init({ ele: '#sample-select', options: [ { label: 'Options 1', value: '1' }, { label: 'Options 2', value: '2' }, { label: 'Options 3', value: '3' }, { label: 'Options 1', value: '1' }, { label: 'Options 2', value: '2' }, { label: 'Options 3', value: '3' }, { label: 'Options 1', value: '1' }, { label: 'Options 2', value: '2' }, { label: 'Options 3', value: '3' }, { label: 'Options 1', value: '1' }, { label: 'Options 2', value: '2' }, { label: 'Options 3', value: '3' }, { label: 'Options 1', value: '1' }, { label: 'Options 2', value: '2' }, { label: 'Options 3', value: '3' }, { label: 'Options 1', value: '1' }, { label: 'Options 2', value: '2' }, { label: 'Options 3', value: '3' }, { label: 'Options 1', value: '1' }, { label: 'Options 2', value: '2' }, { label: 'Options 3', value: '3' }, { label: 'Slabo 27px', value: '1' }, { label: 'Chokokutai', value: '2' }, { label: 'Rubik Wet Paint', value: '3' }, ], labelRenderer: sampleLabelRenderer, selectedLabelRenderer: sampleLabelRenderer }); function sampleLabelRenderer(data) { console.log(data); return `${data.label}`; }
The text was updated successfully, but these errors were encountered:
As a workaround I'm forced to do this now:
function sampleLabelRenderer(data) { var optionItem = document.querySelector('.vscomp-option-text[data-tooltip="'+data.label+'"]').parentNode; var domIndex = Array.prototype.indexOf.call(document.querySelectorAll('.vscomp-option'), optionItem.parentNode); console.log(domIndex); }
Sorry, something went wrong.
No branches or pull requests
For some reason the visible index is always the same as the index on the
data
coming fromlabelRenderer
andsampleLabelRenderer
.Shouldn't one of those values reflect the value of the dropdown item on the DOM?
Demo here (Scroll until the last item on the list)
https://jsfiddle.net/1be6ps5g/
Code for reproduction:
The text was updated successfully, but these errors were encountered: