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

Firing value-changed should not cause repeated value change on element itself #3677

Closed
1 of 6 tasks
nazar-pc opened this issue May 24, 2016 · 1 comment · Fixed by #3678
Closed
1 of 6 tasks

Firing value-changed should not cause repeated value change on element itself #3677

nazar-pc opened this issue May 24, 2016 · 1 comment · Fixed by #3678

Comments

@nazar-pc
Copy link
Contributor

Description

I've created small behavior for myself to simplify data binding to type-extension element input[is=cs-input-text] like following:

Polymer.cs.behaviors.value = {
  listeners: {
    change: '_changed',
    input: '_changed'
  },
  _changed: function(){
    this.fire('value-changed');
  }
};

The idea is that:

<!-- Now I'm able to write following -->
<input is="cs-input-text" value="{{value}}">
<!-- instead of -->
<input is="cs-input-text" value="{{value::input}}">

However, Polymer overrides input.value with the same value when data-binding goes downwards and causes cursor to move from its current position to the end of the text.

Live Demo

https://jsbin.com/juvimisefu/1/edit?html,output

Steps to Reproduce (on Demo)

  1. Put cursor inside of ><
  2. Type single character

Expected Results

Cursor remains right after typed character

Actual Results

Cursor moved to the end of the text

Browsers Affected

  • Chrome
  • Firefox
  • Edge
  • Safari 9
  • Safari 8
  • IE 11

Versions

  • Polymer: v1.4.0
  • webcomponents: v0.7.22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants