User Management: Styling pass
[osm/UI.git] / skyquake / framework / widgets / form_controls / selectOption.jsx
index 81a3860..21d4a0a 100644 (file)
@@ -47,11 +47,19 @@ export default class SelectOption extends React.Component {
     html = (
         <label key={this.props.key}>
             {this.props.label}
-            <select className={this.props.className} onChange={this.handleOnChange} defaultValue={JSON.stringify(defaultValue)} >
-                {
-                 options
-                }
-            </select>
+            {
+              this.props.readonly ? defaultValue
+              : (
+                  <select
+                    className={this.props.className}
+                    onChange={this.handleOnChange}
+                    defaultValue={JSON.stringify(defaultValue)}>
+                      {
+                       options
+                      }
+                  </select>
+                )
+            }
         </label>
     );
     return html;
@@ -67,6 +75,7 @@ SelectOption.defaultProps = {
     console.log(e.target.value)
     console.dir(e)
   },
+  readonly: false,
   /**
    *  Selected or default value
 ​