textarea 文字中间修改,修改完,光标跑到最后一个去
发布于 6 年前 作者 rlei 2468 次浏览 来自 问答

textarea 写上一段文字,在文字中间部位修改,文字输入完光标立马定位到尾部,ios的出现这个问题,安卓是正常的,

问题重现:搜    风尚婚礼人      ==> 简单填写信息  ==> 我的  ==> 发布作品  ==> textarea

4 回复

<textarea class=“area” wx:if="{{!opacityTextarea}}" cursor="{{cursorIndex}}"

focus="{{true}}" name=“content” selection-start="{{cursorIndex}}"

selection-end="{{cursorIndex}}" bindfocus=“bindfocus”

bindinput=“getTextareaValue” value="{{content}}" placeholder=“描述下你的作品吧…”

show-confirm-bar="{{false}}" />

getTextareaValue(e) {

    let { value, cursor } = e.detail;

    this.content = value;

    this.cursorIndex = Number(cursor);

    console.info(‘cursorIndex’, this.cursorIndex, ‘typeof’, typeof this.cursorIndex, ‘content’, content);

    this.$apply();

},

不起作用呀???

没有哦,一直是遗留的bug到现在

遇到同样问题

遇到同样的问题,请问你找到解决办法了吗

回到顶部