KnockoutJS: How to update view model after a user copy'n'paste into a text field?

前端 未结 2 562
礼貌的吻别
礼貌的吻别 2021-02-01 05:32

I am working on a website that auto populates search result in a table after user entered some text in the input text box (similar to google instant search).

I managed t

2条回答
  •  野性不改
    2021-02-01 06:10

    New Way

    Instead of:

    data-bind="value: myValue, valueUpdate: ['input', 'textchange']"
    

    One can now use the textInput binding:

    data-bind="textInput: myValue"
    

    From the documentation:

    The textInput binding links a text box () or text area (