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

setTimeout (called on keydown) changing a property on a controller prevents typing in a field #110

Closed
divdavem opened this issue Mar 27, 2014 · 0 comments

Comments

@divdavem
Copy link
Member

Consider the following file (which is an extract of an autocomplete component). Try typing something in the field.

HSP file

var klass = require("hsp/klass");
var $set= require("hsp/$set");
var Ctrl = klass({
    keyDown: function () {
        if (!this.myTimeout) {
            var self = this;
            $set(this,"myTimeout", setTimeout(function () {
              $set(self,"myTimeout", null);
              // ...
            },5));
        }
    }
});

# template myTemplate using c:Ctrl
      <input onkeydown="{c.keyDown()}" value="{c.value}">
# /template

myTemplate().render("output");

Expected behavior

The input field contains what was typed.

Actual behavior

The input field does not receive all typed keys.

Hashspace version

Issue introduced by commit 601e25f.
It does not happen with previous commit 33b7794.

@divdavem divdavem changed the title setTimeout (called on keydown) and changing a property on a controller prevents typing setTimeout (called on keydown) changing a property on a controller prevents typing Mar 27, 2014
@divdavem divdavem changed the title setTimeout (called on keydown) changing a property on a controller prevents typing setTimeout (called on keydown) changing a property on a controller prevents typing in a field Mar 27, 2014
b-laporte pushed a commit to b-laporte/hashspace that referenced this issue Mar 30, 2014
b-laporte pushed a commit to b-laporte/hashspace that referenced this issue Apr 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant