P
P
PetrTar2019-02-06 07:00:21
css
PetrTar, 2019-02-06 07:00:21

How to expand select after function execution?

There is a select, the option of which is filled dynamically:
"
{{app.customerType == "company"?i.TITLE:i.LAST_NAME+" "+i.NAME}}
"
after the app.customerList has been formed, I run the function that should expand select:
let elem = document.getElementById('select-customer')
let event = document.createEvent('MouseEvents');
event.initMouseEvent('mousedown', true, true, window);
elem.dispatchEvent(event);
, but the event doesn't fire, the select remains "closed".

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Yarkov, 2019-02-06
@PetrTar

No way. Maximum change the size attribute
https://jsfiddle.net/yarkov_aleksei/51dwn2hc/

R
Ragtime Kitty, 2019-02-06
@Ragtime_Kitty

It is impossible to open the default select without clicking, only if you emit and open your own.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question