How to trigger "Tab" keyboard key click from the code

i’ve updated the clone with another idea:
https://anvil.works/build#clone:PZ2QKVDHB6TGANGY=VI5XYKST6HGIH3GHK727YBWM

It utilises this library https://github.com/marklagendijk/jquery.tabbable
and adds four python functions tab_next, focus_next, tab_prev, focus_prev

it chooses the next available element from the flow_panel components so no hard coding of lists…

pseudo code

self.current = # component that last had focus in the flow panel
# it will lose focus as soon as we click next

def next_click(self, **event_args):
  if self.current is None:
    self.flow_panel.get_components()[0].trigger('focus')
  else:
    self.current.trigger('focus')
    tab_next()

2 Likes