mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-23 07:21:22 +02:00
use keydown here, as its a div element
This commit is contained in:
parent
50c88279a0
commit
03f577bea9
@ -113,7 +113,7 @@ module.exports = React.createClass({
|
|||||||
this.props.onChange(parseInt(this.state.customValue), this.props.powerLevelKey);
|
this.props.onChange(parseInt(this.state.customValue), this.props.powerLevelKey);
|
||||||
},
|
},
|
||||||
|
|
||||||
onCustomKeyPress: function(event) {
|
onCustomKeyDown: function(event) {
|
||||||
if (event.key === "Enter") {
|
if (event.key === "Enter") {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
@ -133,7 +133,7 @@ module.exports = React.createClass({
|
|||||||
picker = (
|
picker = (
|
||||||
<Field id={`powerSelector_custom_${this.props.powerLevelKey}`} type="number"
|
<Field id={`powerSelector_custom_${this.props.powerLevelKey}`} type="number"
|
||||||
label={this.props.label || _t("Power level")} max={this.props.maxValue}
|
label={this.props.label || _t("Power level")} max={this.props.maxValue}
|
||||||
onBlur={this.onCustomBlur} onKeyPress={this.onCustomKeyPress} onChange={this.onCustomChange}
|
onBlur={this.onCustomBlur} onKeyDown={this.onCustomKeyDown} onChange={this.onCustomChange}
|
||||||
value={String(this.state.customValue)} disabled={this.props.disabled} />
|
value={String(this.state.customValue)} disabled={this.props.disabled} />
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user