如何避免在用户输入HTML文本输入时退格? [英] How to avoid navigate back when the user types backspace on a HTML text input?

查看:110
本文介绍了如何避免在用户输入HTML文本输入时退格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Backspace是导航返回最后一页的浏览器热键。我知道,当一个输入焦点时,这个热键被禁用。但是我的keyup和keydown事件绑定了这个输入,而我写的东西导致了这个麻烦。



你知道解决方案吗?

解决方案

这个问题是由于在返回onKeyDown事件之前删除输入引起的。


Backspace is the browser hotkey for Navigate Back To The Last Page. I know that when an input has the focus this hotkey is disabled. But I have keyup and keydown events binded to this input, and something I wrote is causing this trouble.

Do you know the solution?

解决方案

The problem was caused by the input removal before returning the onKeyDown event.

这篇关于如何避免在用户输入HTML文本输入时退格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆