JSFiddle - React, Tailwind, and code Playground

by brendanbond

HTML

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css">
<script src="https://cdn.form.io/js/formio.full.js"></script>
<div id="formio"></div>

JavaScript

Formio.createForm(document.getElementById("formio"), {
  components: [
    {
      type: "textfield",
      key: "firstName",
      label: "First Name",
      input: true,
    },
    {
      type: "textfield",
      key: "lastName",
      label: "Last Name",
      input: true,
    },
    {
      type: "button",
      action: "event",
      event: "focusLast",
      label: "Focus Last Name",
    },
  ],
}).then(function (form) {
  form.on('focusLast', () => {
    form.focusOnComponent('lastName');
  })
})