inertiajs / pingcrm

A demo application to illustrate how Inertia.js works.
http://demo.inertiajs.com
MIT License
2.1k stars 767 forks source link

The best way to use the TextInput Component methods? #179

Closed neverender24 closed 5 months ago

neverender24 commented 2 years ago

What's the best way in calling the methods in the TextInput Component?

methods: {
    focus() {
      this.$refs.input.focus()
    },
    select() {
      this.$refs.input.select()
    },
    setSelectionRange(start, end) {
      this.$refs.input.setSelectionRange(start, end)
    },
  },

Right now I'm calling it in the component mounted, while adding $attrs like so

<text-input v-model="form.email" :error="form.errors.email" label="Email" type="email" isFocused="focus"/>

  mounted() {
    if (this.$attrs.isFocused) {
      this.focus()
    }
  },
driesvints commented 5 months ago

Hi there,

Thanks for reporting but it looks like this is a question which can be asked on a support channel. Please only use this issue tracker for reporting bugs with the library itself. If you have a question on how to use functionality provided by this repo you can try one of the following channels:

However, this issue will not be locked and everyone is still free to discuss solutions to your problem!

Thanks.