Knockout binding issue only in FireFox

101 views
Skip to first unread message

Evan Larsen

unread,
Mar 11, 2022, 2:37:36 PM3/11/22
to KnockoutJS
Hello, I created a very simple JS fiddle to illustrate my problem.

If you open the above jsFiddle in Chrome and type in the textbox then everything works as expected but if you open it in Firefox then Firefox is dropping the last letter of whatever you type.

Can anyone please explain to me what I am doing wrong and how I can resolve this issue with firefox?

Thank you!

Evan Larsen

unread,
Mar 11, 2022, 3:42:19 PM3/11/22
to KnockoutJS
Sorry, I think the knockout library wasn't included correctly in the jsfiddle. here is an updated jsfiddle.

Murat Duisenbayev

unread,
Mar 11, 2022, 4:38:54 PM3/11/22
to knock...@googlegroups.com
Seems like the afterkeydown event works little differently on Firefox. Not sure if it is a bug or something else.
Your choices are to either use a different event (valueUpdate: 'input' seems to work), or use textInput binding: https://stackoverflow.com/questions/43812877/input-type-number-binding-issue-with-knockout-in-firefox/43820869#43820869
I would go with the second option, since with the events you cannot be sure that it will work with all browsers



пт, 11 мар. 2022 г. в 21:42, Evan Larsen <evan....@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "KnockoutJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knockoutjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/knockoutjs/5353354a-ff03-4940-91b9-92cf6befdea8n%40googlegroups.com.

Julio Di Egidio

unread,
Mar 12, 2022, 10:12:59 AM3/12/22
to KnockoutJS
On Friday, 11 March 2022 at 22:38:54 UTC+1 muratdui...@gmail.com wrote:
Seems like the afterkeydown event works little differently on Firefox. Not sure if it is a bug or something else.
Your choices are to either use a different event (valueUpdate: 'input' seems to work), or use textInput binding: https://stackoverflow.com/questions/43812877/input-type-number-binding-issue-with-knockout-in-firefox/43820869#43820869
I would go with the second option, since with the events you cannot be sure that it will work with all browsers

Message has been deleted

Evan Larsen

unread,
Mar 14, 2022, 8:09:51 AM3/14/22
to KnockoutJS
Thank you everyone that fixed my issue.
Reply all
Reply to author
Forward
0 new messages