21
Views
2
Comments
Open dropdown search when page loads
Question
Application Type
Mobile

I am trying to figure out how to get a Dropdown search widget to open when the page loads in a mobile app.

Can you help me?

2019-11-11 17-10-24
Manish Jawla
 
MVP

Hi @Andrew Finkelstein ,

You can try the below javascript on Onready event:


setTimeout(function() {

  var dd = document.getElementById('myDropdown');

  if (!dd) return;

  dd.focus && dd.focus();

  try {

    var ev = new KeyboardEvent('keydown', {key:'ArrowDown', keyCode:40, which:40, bubbles:true});

    dd.dispatchEvent(ev);

  } catch(e) {

    try { dd.click && dd.click(); } catch(e2) {}

  }

}, 150); // tweak delay if needed


Hope this helps.

Regards,

Manish Jawla


2026-01-28 16-57-48
Mihai Melencu
Champion

Hi @Andrew Finkelstein ,

If you don't want to use javascript you can use the DropdownOpen client action from OutsystemsUI in the Initialized event of the Dropdown Search.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.