Comments (11)
Do you mean that when el-slider
changes, the home
end
event you customized elsewhere is executed?
from element-plus.
Do you mean that when
el-slider
changes, thehome
end
event you customized elsewhere is executed?
是的,我不需要slider去响应home和end按键的事件,因为这两个按键已经被绑定做其他事情,而且我的应用里也不需要用快捷键去调整至最小值或最大值
from element-plus.
Will this problem occur with el-number-input
?
from element-plus.
Will this problem occur with
el-number-input
?
我没有使用el-number-input ,只使用了 el-slider,当el-slider获得焦点的时候,就会响应home按键
from element-plus.
It would be better to provide a detailed example in the playground.
This may help you solve the problem faster.
from element-plus.
It would be better to provide a detailed example in the playground.
其实不需要我提供一个自己的example,官网上的sl-slider的例子就可以测试呀
https://element-plus.org/zh-CN/component/slider.html
只要el-slider获得焦点,你按home按键或者end按键,他都会自动调整到最小值或者最大值
你可以测试一下,但是我在官方文档却没看到有提供 移除这种快捷按键的办法
而且我上面提交的资料里,有一个playground的例子,我已经提供了
from element-plus.
I see
from element-plus.
You can set a public value to temporarily solve your problem.
from element-plus.
You can set a public value to temporarily solve your problem.
没什么变化,只要点击slider的滑块,然后按home或者end按键,一样是可以操作这个slider,@click.stop 好像并没有起任何作用,我发现@keydown.stop 可以拦截键盘事件传递给子元素,但是对这个slider无效,并不能阻止他响应键盘事件,他内部是如何实现的?全局键盘监听?现在好像并没有办法让他不响应....
from element-plus.
You can set a public value to temporarily solve your problem.
找到办法了,我翻了下他的代码
const onHomeKeyDown = () => {
if (disabled.value) return
setPosition(0)
emitChange()
}
我在keydown.capture 中设置disable, keyup.capture中取消disable就可以了,他并没有提供取消的办法,唯一让他不响应的就是disable状态,只能这么处理
from element-plus.
It is best to handle this problem by adding a new props attribute with a default value of true
.
You can try submitting a PR yourself or wait for someone else or me to be available to fix this.
from element-plus.
Related Issues (20)
- [Component] [tooltip] el-tooltip default slot is a section with v-for will only render the first of v-for loop HOT 7
- [Component] [tag] el-tag组件再移除时没有动画 HOT 2
- [Component] [tree-select] TreeSelect 组件结合 persistent 属性使用时回显异常
- [Component] [select, dialog] After setting open's animation for dialog, el-select can't show the label; 给dialog设置动画效果,里面的select组件无法正常显示
- [Component] [select, dialog] 给dialog设置打开时的动画效果后,dialog里面的select组件无法正常显示所选label HOT 1
- [Component] [dialog, message-box] Overflow screen when dragging and dropping Message Box and Dialogue HOT 1
- [Component] [select] select multiple 会自动触发一次表单校验 HOT 3
- [Component] persistent为false 时,popover组件存在内存泄漏
- [Component] [tabs] Tabs 手动设置宽度,标签标题不能沾满父级宽度
- [Style] [table] [el-table] in safari the column is misalignment HOT 1
- [Component] [button] loading position error
- [Component] [select-v2] 关于select-v2的BUG HOT 1
- [TypeScript] [All] 使用pnpm安装依赖时,全局组件会失去类型提示 HOT 8
- [Component] [select] el-select使用clearable清空后,类型变为undefined HOT 3
- [TypeScript] tsconfig 配置 Volar 支持 compilerOptions.types 及路径别名 compilerOptions.paths 后 vscode 路径感知变慢
- [Component] [tree-select] with teleported="false" dropdown closes abnormally HOT 1
- [Component] [button] Button auto hover and active color not working when `color` obtained from css variable HOT 2
- [Component] [date-picker] el-date-picker支持多选单个年和日期,但是不支持多选单个月份 HOT 1
- [Component] [date-picker] el-date memory overflow HOT 4
- [Performance] [drawer] el-drawer中嵌套el-drawer,设置modal-class中属性为backdrop-filter: blur(5px),会导致drawer中的内容卡顿
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from element-plus.