更改事件中的 METEOR 仅在您单击文本区域后才会在文本区域上触发

METEOR on change event only get's fired on a text area after you click out of the text area

本文关键字:文本 区域 事件 METEOR 单击      更新时间:2023-09-26

这是我的模板:

<template name="textGoesHere">
{{#if currentUser}}
    <div id="boxdiv">
        <textarea id="box">{{user.text}}</textarea>
    </div>
{{/if}}
</template>

这是我的流星事件:

'change #box': function (e) {
        Meteor.call('click', $("#box").val());
}

出于某种原因,此事件仅在更改其内容后单击文本区域后才会触发。但显然,该事件应该在文本区域更改时调用,这是我正在寻找的功能。

如果要

涵盖处理此类输入的基础,请尝试查找以下事件: 'input change paste keyup mouseup'

更全面一点(对我来说)这个:

'change #box, paste #box, keyup #box, mouseup #box': function (e) {
        Meteor.call('click', $("#box").val());
}