fix(inputs): keyboard focus improvements (#16838)

fixes #16815
fixes #16872
fixes #13978
fixes #16610
This commit is contained in:
Manu MA
2019-01-11 19:36:02 +01:00
committed by GitHub
parent 275d385c17
commit 6364e4e2a1
38 changed files with 263 additions and 234 deletions

View File

@ -165,7 +165,7 @@ export class Range implements ComponentInterface {
this.gesture.setDisabled(this.disabled);
}
private handleKeyboard(knob: string, isIncrease: boolean) {
private handleKeyboard = (knob: string, isIncrease: boolean) => {
let step = this.step;
step = step > 0 ? step : 1;
step = step / (this.max - this.min);
@ -173,9 +173,9 @@ export class Range implements ComponentInterface {
step *= -1;
}
if (knob === 'A') {
this.ratioA += step;
this.ratioA = clamp(0, this.ratioA + step, 1);
} else {
this.ratioB += step;
this.ratioB = clamp(0, this.ratioB + step, 1);
}
this.updateValue();
}
@ -378,7 +378,7 @@ export class Range implements ComponentInterface {
ratio: this.ratioA,
pin: this.pin,
disabled: this.disabled,
handleKeyboard: this.handleKeyboard.bind(this),
handleKeyboard: this.handleKeyboard,
min,
max
})}
@ -390,7 +390,7 @@ export class Range implements ComponentInterface {
ratio: this.ratioB,
pin: this.pin,
disabled: this.disabled,
handleKeyboard: this.handleKeyboard.bind(this),
handleKeyboard: this.handleKeyboard,
min,
max
})}