How to delay onInput

Hi all,
How do I delay "onInput" from firing until I stop typing for some seconds?.

Regards
Sandbox

Comments

  • You can't stop the event from firing but you can defer your handling of the event.

    http://jsfiddle.net/b4r2eyqy/
    enyo.kind({
        name: 'ex.App',
        components: [
            {name: 'input', kind: 'Input', oninput: 'handleInput'},
            {name: 'content'}
        ],
        handleInput: function (sender, event) {
            this.startJob('wait a bit', 'processInput', 500);
        },
        processInput: function () {
            this.$.content.set('content', this.$.input.value);
        }
    });
  • Thanks you very much theryanjduffy

    Kind regards,
    Sandbox
Sign In or Register to comment.