In our project, we have implemented a drop down feature using React AntD design which does not utilize the Select
tag. You can find an example of this implementation here.
https://i.sstatic.net/pRG1m.png
The options for the drop down are generated using ul
and li
tags, as depicted in the image below -
https://i.sstatic.net/eKalM.png
I am looking to understand how one can handle or select a specific option using an index with this type of drop down menu.
In case of using Select
, one can typically employ the page.select()
method, as indicated in this Stack Overflow discussion found here. However, attempting this method did not result in a successful selection from this unique drop down.
An alternative approach I tried involved utilizing page.keyboard.type('ArrowDown')
and page.keyboard.type('Enter')
to simulate key presses for navigation within the drop down menu. Unfortunately, this resulted in a
TypeError: (intermediate value) is not a function
error.