You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-17 17:42:41 +03:00
allow label to be empty on power selector
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user