Commit b87d0497 authored by Nicolas Frandeboeuf's avatar Nicolas Frandeboeuf
Browse files

Do not disable custom label in modale on mobile

parent 12864fe8
Pipeline #16891 passed with stage
in 2 minutes and 33 seconds
......@@ -103,12 +103,19 @@ class LabelComponent_ extends React.Component {
this.state.editedValue :
this.getDefaultValue();
let labelVisibility = 'hidden';
let inputVisibility = '';
if (this.props.readonlyOnSmallScreens) {
labelVisibility = 'visible-xs-inline';
inputVisibility = 'hidden-xs';
}
return (<div className="label-component-container">
<span className="text-uppercase visible-xs-inline label-component">
<span className={ `text-uppercase label-component ${labelVisibility}` }>
{ label }
</span>
<input
className="form-control operation-label-input hidden-xs"
className={ `form-control operation-label-input ${inputVisibility}` }
type="text"
value={ label }
onChange={ this.handleChange }
......@@ -129,11 +136,15 @@ LabelComponent_.propTypes = {
displayLabelIfNoCustom: PropTypes.bool,
// A function to set the custom label when modified.
setCustomLabel: PropTypes.func.isRequired
setCustomLabel: PropTypes.func.isRequired,
// Whether the label is readonly on small screens.
readonlyOnSmallScreens: PropTypes.bool
};
LabelComponent_.defaultProps = {
displayLabelIfNoCustom: true
displayLabelIfNoCustom: true,
readonlyOnSmallScreens: false
};
function mapDispatch(component) {
......@@ -156,6 +167,7 @@ const OperationListViewLabel_ = props => {
<LabelComponent
operation={ props.operation }
setCustomLabel={ props.setCustomLabel }
readonlyOnSmallScreens={ true }
/>
);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment