Skip to content

I found bug when re render is not update value input[type=text] after switch to another <input/> and insert data. #81

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

Closed
tlecreate opened this issue May 27, 2017 · 1 comment

Comments

@tlecreate
Copy link

tlecreate commented May 27, 2017

Vue.component({
  data() {
    return { test: '' }
  },
  render (h) {
    return (
      <div>
        <input type="text" ref="one" on-input={(e) => { this.test = e.target.value }} value={this.test} />
        <input type="text" ref="two" on-input={(e) => { this.test = e.target.value }} value={this.test} />
      </div>
    )
  }
})

Please follow my step.

  1. Insert data on [ref=one] and [ref=two] that's right.
  2. Switch to [ref=two] and insert data, It will crash not worked both.

Now i solved problem like this example.

<input
  type="text"
  ref="one"
  on-input={(e) => {
    this.test = e.target.value
    this.$refs.two.value = this.test
  }}
  value={this.test} />

<input
  type="text"
  ref="two"
  on-input={(e) => {
    this.test = e.target.value
    this.$refs.one.value = this.test
  }}
  value={this.test} />

But i think, It's too bad way to resolve this solution.
Please check and recommend best way.
Thank you.

@tlecreate tlecreate changed the title I found bug when re render is not update value input[type=text] after switch another <input/> and insert data. I found bug when re render is not update value input[type=text] after switch to another <input/> and insert data. Jun 10, 2017
@tlecreate
Copy link
Author

It already fix from #84 (comment).

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