Input mixin ( quasar-framework\src\mixins\input.js) is wrong



  • It seems that in the input mixins files there are error. Example: the focus mixin is defined as below

    methods: {
    focus () {
    if (!this.disable) {
    this.$refs.input.focus()
    }
    },

    which assumes that the elements is has a ref “input”. If the user prefers some other name, then element does not get the focus.

    example: I had something like that:

      <q-field v-bind="$attrs" label-width="4">
        <q-input :value="initial" :placeholder="placeholder" @input="input"  hide-underline  ref="query"
                 style="border-color:cadetblue; border-radius:5px;   border-style:solid; border-width:1px">
          <q-autocomplete :value="initial" @search="search" @selected="selected" @input="input"  
                          @show="show" @hide="hide" :min-characters="mincharacters">
          </q-autocomplete>
        </q-input>
      </q-field>
    

    and some where in the code I have

    this.$refs.query.focus();

    Since I did not name my q-input as ‘input’ but ‘query’, my element does not get the focus.
    all references to

    this.$refs.input.focus()
    needs to be corrected

    Regards
    Sedat



  • $refs.inputEditName.focus()
    works fine