Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitea8e34c

Browse files
committed
fixed unnecessarily blocked keydown events
1 parent838d787 commitea8e34c

File tree

10 files changed

+96
-91
lines changed

10 files changed

+96
-91
lines changed

‎.nvmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
11

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ The solution:
116116
| max-range* | Number | null | Maximum range in range mode
117117
| process-draggable*| Boolean| false| Whether the process bar is draggable (valid only in range mode).|
118118
| formatter*      | String,Function| null  | Formatting of a tooltip's values, for example:`formatter='¥{value}'` or`` formatter: (v) => `¥${v}```.|
119-
| use-keyboard*| Boolean| false| Whether to open the keyboard control (Only support the arrow keys).|
119+
| use-keyboard*| Boolean| false| Whether to open the keyboard control (only supports the arrow keys).|
120120
| actions-keyboard*| Array|`[(i) => i - 1, (i) => i + 1]`| In the keyboard control mode, reduce(←, ↓) and increase(→, ↑) the calling method.(`i` is the index value)|
121121
| bg-style*| Object| null| The style of the background.|
122122
| slider-style*| Object[, Array(in range model), Function<Value, Index>]| null| The style of the slider.|

‎dist/vue-range-slider.css‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎dist/vue-range-slider.css.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎dist/vue-range-slider.esm.js‎

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* vue-range-slider v1.0.3
3-
* (c) 2016-2018 xwpongithub
3+
* (c) 2016-2019 xwpongithub
44
* Released under the MIT License.
55
*/
66

@@ -111,42 +111,42 @@ var Slider = {
111111
// 是否显示组件
112112
show:{
113113
type:Boolean,
114-
default:true
114+
"default":true
115115
},
116116
// 值
117117
value:{
118118
type:[String,Number,Array,Object],
119-
default:0
119+
"default":0
120120
},
121121
// 最小值
122122
min:{
123123
type:Number,
124-
default:0
124+
"default":0
125125
},
126126
// 最大值
127127
max:{
128128
type:Number,
129-
default:100
129+
"default":100
130130
},
131131
// 分段间隔
132132
step:{
133133
type:Number,
134-
default:1
134+
"default":1
135135
},
136136
// 组件宽度
137137
width:{
138138
type:[Number,String],
139-
default:'auto'
139+
"default":'auto'
140140
},
141141
// 组件高度
142142
height:{
143143
type:[Number,String],
144-
default:6
144+
"default":6
145145
},
146146
// 滑块大小
147147
dotSize:{
148148
type:Number,
149-
default:16
149+
"default":16
150150
},
151151
dotWidth:{
152152
type:Number,
@@ -158,71 +158,71 @@ var Slider = {
158158
},
159159
stopPropagation:{
160160
type:Boolean,
161-
default:false
161+
"default":false
162162
},
163163
// 事件类型
164164
eventType:{
165165
type:String,
166-
default:'auto'
166+
"default":'auto'
167167
},
168168
// 是否实时计算组件布局
169169
realTime:{
170170
type:Boolean,
171-
default:false
171+
"default":false
172172
},
173173
// 是否显示工具提示
174174
tooltip:{
175175
type:[String,Boolean],
176-
default:'always',
176+
"default":'always',
177177
validator:functionvalidator(val){
178178
return['hover','always'].indexOf(val)>-1;
179179
}
180180
},
181181
// 组件方向
182182
direction:{
183183
type:String,
184-
default:'horizontal',
184+
"default":'horizontal',
185185
validator:functionvalidator(val){
186186
return['horizontal','vertical'].indexOf(val)>-1;
187187
}
188188
},
189189
// 是否反向组件
190190
reverse:{
191191
type:Boolean,
192-
default:false
192+
"default":false
193193
},
194194
// 是否不可用
195195
disabled:{
196196
type:[Boolean,Array],
197-
default:false
197+
"default":false
198198
},
199199
piecewiseLabel:{
200200
type:Boolean,
201-
default:false
201+
"default":false
202202
},
203203
piecewise:{
204204
type:Boolean,
205-
default:false
205+
"default":false
206206
},
207207
// 进度条是否可拖拽(只限范围模式)
208208
processDraggable:{
209209
type:Boolean,
210-
default:false
210+
"default":false
211211
},
212212
// 是否可点击的
213213
clickable:{
214214
type:Boolean,
215-
default:true
215+
"default":true
216216
},
217217
// 是否固定距离
218218
fixed:{
219219
type:Boolean,
220-
default:false
220+
"default":false
221221
},
222222
// 是否为开发环境(打印错误)
223223
debug:{
224224
type:Boolean,
225-
default:true
225+
"default":true
226226
},
227227
// 最小范围
228228
minRange:{
@@ -234,35 +234,35 @@ var Slider = {
234234
},
235235
tooltipMerge:{
236236
type:Boolean,
237-
default:true
237+
"default":true
238238
},
239239
// 是否开启初始动画
240240
startAnimation:{
241241
type:Boolean,
242-
default:false
242+
"default":false
243243
},
244244
// 是否在拖拽结束后同步值
245245
lazy:{
246246
type:Boolean,
247-
default:false
247+
"default":false
248248
},
249249
// 在范围模式中,是否允许交叉
250250
enableCross:{
251251
type:Boolean,
252-
default:true
252+
"default":true
253253
},
254254
// 动画速度比
255255
speed:{
256256
type:Number,
257-
default:0.5
257+
"default":0.5
258258
},
259259
useKeyboard:{
260260
type:Boolean,
261-
default:false
261+
"default":false
262262
},
263263
actionsKeyboard:{
264264
type:Array,
265-
default:function_default(){
265+
"default":function_default(){
266266
return[function(i){
267267
returni-1;
268268
},function(i){
@@ -320,7 +320,7 @@ var Slider = {
320320
vardot0=h('div',{
321321
ref:'dot0',
322322
staticClass:'slider-dot',
323-
class:[this.tooltipStatus,{
323+
"class":[this.tooltipStatus,{
324324
'slider-dot-focus':this.focusFlag&&this.focusSlider===0,
325325
'slider-dot-dragging':this.flag&&this.currentSlider===0,
326326
'slider-dot-disabled':!this.boolDisabled&&this.disabledArray[0]
@@ -336,7 +336,7 @@ var Slider = {
336336
}),h('div',{
337337
ref:'tooltip0',
338338
staticClass:'slider-tooltip-wrap',
339-
class:"slider-tooltip-".concat(this.tooltipDirection[0])
339+
"class":"slider-tooltip-".concat(this.tooltipDirection[0])
340340
},[this._t('tooltip',[h('span',{
341341
staticClass:'slider-tooltip',
342342
style:this.tooltipStyles[0]
@@ -349,7 +349,7 @@ var Slider = {
349349
vardot1=h('div',{
350350
ref:'dot1',
351351
staticClass:'slider-dot',
352-
class:[this.tooltipStatus,{
352+
"class":[this.tooltipStatus,{
353353
'slider-dot-focus':this.focusFlag&&this.focusSlider===1,
354354
'slider-dot-dragging':this.flag&&this.currentSlider===1,
355355
'slider-dot-disabled':!this.boolDisabled&&this.disabledArray[1]
@@ -365,7 +365,7 @@ var Slider = {
365365
}),h('div',{
366366
ref:'tooltip1',
367367
staticClass:'slider-tooltip-wrap',
368-
class:"slider-tooltip-".concat(this.tooltipDirection[1])
368+
"class":"slider-tooltip-".concat(this.tooltipDirection[1])
369369
},[this._t('tooltip',[h('span',{
370370
staticClass:'slider-tooltip',
371371
style:this.tooltipStyles[1]
@@ -379,7 +379,7 @@ var Slider = {
379379
vardot=h('div',{
380380
ref:'dot',
381381
staticClass:'slider-dot',
382-
class:[this.tooltipStatus,{
382+
"class":[this.tooltipStatus,{
383383
'slider-dot-focus':this.focusFlag&&this.focusSlider===0,
384384
'slider-dot-dragging':this.flag&&this.currentSlider===0
385385
}],
@@ -392,7 +392,7 @@ var Slider = {
392392
disabled:this.boolDisabled
393393
}),h('div',{
394394
staticClass:'slider-tooltip-wrap',
395-
class:"slider-tooltip-".concat(this.tooltipDirection)
395+
"class":"slider-tooltip-".concat(this.tooltipDirection)
396396
},[this._t('tooltip',[h('span',{
397397
staticClass:'slider-tooltip',
398398
style:this.tooltipStyles
@@ -448,7 +448,7 @@ var Slider = {
448448
varprocessBlock=h('div',{
449449
ref:'process',
450450
staticClass:'slider-process',
451-
class:{
451+
"class":{
452452
'slider-process-draggable':this.isRange&&this.processDraggable
453453
},
454454
style:this.processStyle,
@@ -460,7 +460,7 @@ var Slider = {
460460
},[h('div',{
461461
ref:'mergedTooltip',
462462
staticClass:'merged-tooltip slider-tooltip-wrap',
463-
class:"slider-tooltip-".concat(this.isRange ?this.tooltipDirection[0] :this.tooltipDirection),
463+
"class":"slider-tooltip-".concat(this.isRange ?this.tooltipDirection[0] :this.tooltipDirection),
464464
style:this.tooltipMergedPosition
465465
},[this._t('tooltip',[h('span',{
466466
staticClass:'slider-tooltip',
@@ -493,7 +493,7 @@ var Slider = {
493493
returnh('div',{
494494
ref:'wrap',
495495
staticClass:'vue-range-slider slider-component',
496-
class:[this.flowDirection,this.disabledClass,this.stateClass,{
496+
"class":[this.flowDirection,this.disabledClass,this.stateClass,{
497497
'slider-has-label':this.piecewiseLabel
498498
}],
499499
style:[this.wrapStyles,this.boolDisabled ?this.disabledStyle :null],
@@ -1174,9 +1174,6 @@ var Slider = {
11741174
this.focusFlag=false;
11751175
},
11761176
handleKeydown:functionhandleKeydown(e){
1177-
e.preventDefault();
1178-
e.stopPropagation();
1179-
11801177
if(!this.useKeyboard){
11811178
returnfalse;
11821179
}
@@ -1186,13 +1183,17 @@ var Slider = {
11861183
switch(keyCode){
11871184
case37:
11881185
case40:
1186+
e.preventDefault();// e.stopPropagation()
1187+
11891188
this.keydownFlag=true;
11901189
this.flag=true;
11911190
this.changeFocusSlider(this.actionsKeyboard[0]);
11921191
break;
11931192

11941193
case38:
11951194
case39:
1195+
e.preventDefault();// e.stopPropagation()
1196+
11961197
this.keydownFlag=true;
11971198
this.flag=true;
11981199
this.changeFocusSlider(this.actionsKeyboard[1]);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp