allow label to be empty on power selector

This commit is contained in:
Bruno Windels 2019-11-14 16:58:37 +01:00
parent b278531f2f
commit d0914f9208

View file

@ -129,10 +129,11 @@ module.exports = createReactClass({
render: function() { render: function() {
let picker; let picker;
const label = typeof this.props.label === "undefined" ? _t("Power level") : this.props.label;
if (this.state.custom) { if (this.state.custom) {
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={label} max={this.props.maxValue}
onBlur={this.onCustomBlur} onKeyDown={this.onCustomKeyDown} 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} />
); );
@ -151,7 +152,7 @@ module.exports = createReactClass({
picker = ( picker = (
<Field id={`powerSelector_notCustom_${this.props.powerLevelKey}`} element="select" <Field id={`powerSelector_notCustom_${this.props.powerLevelKey}`} element="select"
label={this.props.label || _t("Power level")} onChange={this.onSelectChange} label={label} onChange={this.onSelectChange}
value={String(this.state.selectValue)} disabled={this.props.disabled}> value={String(this.state.selectValue)} disabled={this.props.disabled}>
{options} {options}
</Field> </Field>