No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

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

    Framework
    2
    2
    583
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sedatyilmazer last edited by

      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

      1 Reply Last reply Reply Quote 0
      • dan-leech
        dan-leech last edited by

        $refs.inputEditName.focus()
        works fine

        1 Reply Last reply Reply Quote 0
        • First post
          Last post