title: How set default button on cancel in quasar dialog
body: <p>I Need to put focus on cancel button of my confim dialog box.</p>
  <p>I work with vue/Quasar. I've a delete button , and before deletion I create a confim dialogbox. It's Ok. But just want the default button focused is &quot;Cancel&quot; not &quot;ok&quot;</p>
  <pre class="lang-js prettyprint-override"><code>this.$q.dialog({
      title: 'Confirmation',
      message: &quot;Etes-vous sûr de vouloir supprimer l''entité: &quot; ,
      ok: 'Suppression',
      cancel: {
          push: true,
          color: 'negative',
          label:&quot;Annuler&quot;
      },
      persistent: true
  })
  </code></pre>
  <p>With that it'sok button selectd by default not the cancel button</p>
  <h2>UPDATE</h2>
  <pre class="lang-js prettyprint-override"><code>this.$q.dialog({
      title: 'Confirmation',
      message: &quot;Etes-vous sûr de vouloir supprimer l''entité: &quot; + libelle,
      ok: {
          push: true,
          label: &quot;Suppression&quot;,
          tabindex: 1
      },
      cancel: {
          push: true,
          color: 'negative',
          label: &quot;Annuler&quot;,
          tabindex: 0
      },
      persistent: true
  })
  </code></pre>
  <p>Change the tabindex but not the autofocus on button</p>
  <h2>UPDATE 2</h2>
  <pre class="lang-js prettyprint-override"><code>this.$q.dialog({
      ref: &quot;ConfirmDialog&quot;,
      title: 'Confirmation',
      message: &quot;Etes-vous sûr de vouloir supprimer l''entité: &quot; + libelle,
      ok: {
          push: true,
          label: &quot;Suppression&quot;,
          tabindex: 1
      },
      cancel: {
          ref:&quot;btnAnnul&quot;,
          push: true,
          color: 'negative',
          label: &quot;Annuler&quot;,
          tabindex: 0
      },
      persistent: true,
      created: setTimeout(x =&gt; {this.$nextTick(() =&gt; this.focus());}, 1000)
  })
  </code></pre>
  <p>I Progress, Now I can execute after create dialog event, but don't know how access to the button. I see too Autofocus=&quot;autofocus&quot; on ok button</p>
  <p>Perhpas better if I put my full compoment. It's a tree with option on end of each line. One option is delete. I Create a dialog to ask confirmation.</p>
  <pre class="lang-js prettyprint-override"><code>Vue.component('select-tree-nocheck', {
      inject: ['IsConnected', 'showNotifError'],
      props: ['treedata'],
      template: ' &lt;div class=&quot;q-pa-md  q-col-gutter-sm&quot;&gt;\
                      &lt;q-input ref=&quot;filter&quot; filled v-model=&quot;treedata.filter&quot; label=&quot;Filtrer&quot;&gt;\
                          &lt;template v-slot: append&gt;\
                              &lt;q-icon v-if=&quot;treedata.filter !== \'\'&quot; name=&quot;clear&quot; class=&quot;cursor-pointer&quot; v-on:click=&quot;resetFilter&quot; /&gt;\
                          &lt;/template&gt;\
                      &lt;/q-input&gt;\
                      &lt;q-tree ref=&quot;tree&quot; class=&quot;col-12&quot; accordion v-bind:nodes=&quot;treedata.nodes&quot; node-key=&quot;id&quot;  v-bind:filter=&quot;treedata.filter&quot;&gt;\
                          &lt;template v-slot:default-header=&quot;prop&quot;&gt;\
                              &lt;div class=&quot;row&quot;&gt;\
                                    &lt;div&gt;{{ prop.node.label }}\
                              &amp;nbsp;&amp;nbsp;...&lt;q-menu anchor=&quot;top right&quot; self=&quot;top left&quot;&gt;&lt;q-list style=&quot;min-width: 100px&quot;&gt;\
                                     
                                      &lt;q-item clickable v-close-popup&gt;&lt;q-item-section v-on:click=&quot;Suppression(prop.node.id,prop.node.label)&quot;&gt;Supprimer&lt;/q-item-section&gt;&lt;/q-item&gt;\
                                  &lt;/q-list&gt;&lt;/q-menu&gt;\
                              &lt;/div&gt;&lt;/div&gt;\
                          &lt;/template&gt;\
                      &lt;/q-tree&gt;\
                  &lt;/div&gt;',
      methods: { 
          Suppression(value, libelle) {
              this.IsConnected().then(retour =&gt; {
                  if (retour == 1) {
                      this.$q.dialog({
                          $ref: &quot;ConfirmDialog&quot;,
                          title: 'Confirmation',
                          message: &quot;Etes-vous sûr de vouloir supprimer l''entité: &quot; + libelle,
                          ok: {
                              push: true,
                              label: &quot;Suppression&quot;,
                              tabindex: 1
                          },
                          cancel: {
                              $ref:&quot;btnAnnul&quot;,
                              push: true,
                              color: 'negative',
                              label: &quot;Annuler&quot;,
                              tabindex: 0
                          },
                          persistent: true,
                          created: setTimeout(x =&gt; {this.$nextTick(() =&gt; this.focus());}, 1000)
                      }).onOk(() =&gt; {
                          
                      });
                  }
              });
          },
          resetFilter() {
              this.treedata.filter = '';
              this.$refs.filter.focus();
          }
      },
  });
  </code></pre>