禁用“在退格键上删除" (或完全删除ibeam) [英] Disable "remove on backspace" (or remove ibeam entirely)

查看:91
本文介绍了禁用“在退格键上删除" (或完全删除ibeam)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用selectize.js创建一个自定义选择框.到目前为止,它很容易配置,API支持几乎所有内容.我需要做的最后一件事是禁用选项以按退格键删除项目.为此,我找不到用于配置属性的任何方法.您对如何实现这一目标有任何想法吗?

I'm trying to make a custom select box using selectize.js. So far it was easy to configure and the API supports about everything. The last thing I need to do is disable the option to remove items pressing backspace. For this I couldn't find any methods to call of properties to configure. Do you have any idea on how to achieve this?

另外,对我有用的另一件事是禁用"ibeam".此功能使您可以使用箭头键在所选项目之间导航.禁用此功能后,用户将只能删除对我来说不是什么大问题的最后一项.

Also, another thing that would work for me will be to disable "ibeam". This is the feature that allows you to use the arrow keys to navigate between the selected items. Is this is disabled the user will be able to remove only the last item which is not a big issue for me.

理想的解决方案是同时禁用两者,但同时禁用其中之一也可以.

The perfect solution is to disable both, but disabling one of them will work too.

谢谢

推荐答案

我添加了3个新的配置选项,将其提交给github并进行了公关.

I've added 3 new config options, submitted them to github and also made a PR.

  1. disableDelete:禁用在退格键上删除"
  2. disableCaret:禁用项目之间的移动
  3. hidePlaceholder:当至少选择一项时,隐藏占位符

在接受PR之前,这里是我的仓库: https://github.com/deiucanta/selectize. js

Until the PR is accepted here is my repo: https://github.com/deiucanta/selectize.js

这篇关于禁用“在退格键上删除" (或完全删除ibeam)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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