Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use vue-at with textarea #11

Open
haydarai opened this issue Jun 23, 2017 · 17 comments
Open

Use vue-at with textarea #11

haydarai opened this issue Jun 23, 2017 · 17 comments

Comments

@haydarai
Copy link

When I try to use this example with <div class="editor" contenteditable></div> :

<template>
  <div id="mention">
    <at :members="members" >
      <template slot="item" scope="s">
        <span v-text="s.item"></span>
      </template>

      <div class="editor" contenteditable></div>
    </at>
  </div>
</template>

It works just fine, but when I change it to use textArea, it didn't work at all. Is there any way I can use vue-at with textarea?

@fritx
Copy link
Owner

fritx commented Jun 23, 2017

Hi @haydarai , thanks for using vue-at.
Currently vue-at only supports contenteditable, textarea is not yet implemented.

I'm interested in the feature.
Any PR is appreciated too.

@fritx fritx mentioned this issue Jun 23, 2017
33 tasks
@alex-bowers
Copy link

Is this something near to the top of your 'To do list'? Would be very useful.

@fritx fritx self-assigned this Jul 13, 2017
@jbrooksuk
Copy link

@fritx is this something you can do?

@fritx
Copy link
Owner

fritx commented Aug 8, 2017

Yeah, I wanted to have this feature.
Looks like just some api modification.

But I was not very free yet.
Would be great to see some work on this too.

fritx added a commit that referenced this issue Aug 13, 2017
@fritx
Copy link
Owner

fritx commented Aug 13, 2017

@haydarai @alex-bowers @jbrooksuk hey guys

textarea feature is out with 2.2.0 2.2.1, please try 😃

usage:

<template>
  <at-textarea>
    <textarea></textarea>
  </at-textarea>
</template>

<script>
// import At from 'vue-at' // for content-editable
import AtTextarea from 'vue-at/dist/vue-at-textarea' // for textarea

export default {
  components: { AtTextarea }
}
</script>
npm i -S textarea-caret  # also, for textarea

@fritx fritx added the fixed label Aug 13, 2017
@nocrates
Copy link

nocrates commented Sep 8, 2017

@fritx
Just a clarification ... does this use the same attributes and slots as <at> ?

For example, can I do this ?? :

<template>
  <at-textarea :members="members" >
   <template slot="item" scope="s">
        <span v-text="s.item"></span>
     </template>
    <textarea></textarea>
  </at-textarea>
</template>

@nocrates
Copy link

nocrates commented Sep 8, 2017

Answer: Yes!

@fritx
Copy link
Owner

fritx commented Sep 10, 2017

@nocrates yes, if you had any problem, let me know.
Btw, a live-demo and documentation is coming soon~~

@pingshunhuangalex
Copy link

pingshunhuangalex commented Sep 13, 2017

@fritx Is there a way to make it work with input instead of textarea? Thanks.

@fritx
Copy link
Owner

fritx commented Sep 13, 2017

@pingshunhuangalex hmm that would be another feature request.
Could you replace your input just with a one-row textarea or not?

Btw, the brand new documentation is out: https://fritx.github.io/vue-at

@fritx fritx removed their assignment Sep 16, 2017
fritx added a commit that referenced this issue Nov 6, 2017
@seanodotcom
Copy link

Thanks for the adding the textarea option. However, two issues:

  1. When using v-model on the textarea, the model is not updated when an option is selected, but on the next keystroke. This can lead to incomplete information.

  2. A trailing space is added when an option is selected. Can this behavior be removed? Perhaps through an option?

@fritx
Copy link
Owner

fritx commented Sep 10, 2018

@seanodotcom nice to have your suggestion.

  1. Did you put v-model on the <at-ta> instead of <textarea> as documented? -- https://fritx.github.io/vue-at/#/en/vmodel

  2. There is a prop suffix but not yet documented which defaults to be ' ' -- https://github.com/fritx/vue-at/blob/dev/src/At.vue#L25-L28, give it a try: <at-ta suffix="">

@ZavilenskyIlya
Copy link

Not work v-model . After the message seanodotcom nothing has changed

                 <template>
                                <at-ta :members="members" name-key="value" v-model="text">
                                    <template slot="item" slot-scope="s">
                                        <span v-text="s.item.name"></span>
                                    </template>

                                    <textarea style="width: 100%" ></textarea>
                                </at-ta>
                            </template>

@fritx
Copy link
Owner

fritx commented Apr 3, 2019

@ZavilenskyIlya is text in your data section?

@ZavilenskyIlya
Copy link

ZavilenskyIlya commented Apr 3, 2019

@fritx Yes

@hazanncv
Copy link

hazanncv commented Apr 22, 2020

npm i -S textarea-caret

You need to put this in docs!!! I was searching for a while. It works know :))

@fritx
Copy link
Owner

fritx commented Apr 23, 2020

@hazanncv yes thanks for the suggestion!
It is already documented in the "Textarea" section of Readme
but it is unobvious indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants