aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/components/common
diff options
context:
space:
mode:
authorClemens <cle1000.cb@gmail.com>2016-08-17 11:07:56 +0200
committerClemens <cle1000.cb@gmail.com>2016-08-17 11:07:56 +0200
commit2236ed4ba5a01f899fb964e51b82e41028665a47 (patch)
treee0fb468524c37bf8cc9a782df2408b34d77b74b0 /web/src/js/components/common
parentdbec2e094009501ccb75c96ad9f8e936c3b406e3 (diff)
downloadmitmproxy-2236ed4ba5a01f899fb964e51b82e41028665a47.tar.gz
mitmproxy-2236ed4ba5a01f899fb964e51b82e41028665a47.tar.bz2
mitmproxy-2236ed4ba5a01f899fb964e51b82e41028665a47.zip
fix deselection on delete, fix toggleInputButton props
Diffstat (limited to 'web/src/js/components/common')
-rw-r--r--web/src/js/components/common/ToggleInputButton.jsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/web/src/js/components/common/ToggleInputButton.jsx b/web/src/js/components/common/ToggleInputButton.jsx
index b019dfa3..5fa24c10 100644
--- a/web/src/js/components/common/ToggleInputButton.jsx
+++ b/web/src/js/components/common/ToggleInputButton.jsx
@@ -6,7 +6,7 @@ export default class ToggleInputButton extends Component {
static propTypes = {
name: PropTypes.string.isRequired,
- txt: PropTypes.string.isRequired,
+ txt: PropTypes.string,
onToggleChanged: PropTypes.func.isRequired,
checked: PropTypes.bool.isRequired,
placeholder: PropTypes.string.isRequired,
@@ -15,7 +15,7 @@ export default class ToggleInputButton extends Component {
constructor(props) {
super(props)
- this.state = { txt: props.txt }
+ this.state = { txt: props.txt || '' }
}
onKeyDown(e) {
@@ -41,7 +41,7 @@ export default class ToggleInputButton extends Component {
className="form-control"
placeholder={placeholder}
disabled={checked}
- value={this.state.txt || ''}
+ value={this.state.txt}
type={inputType || 'text'}
onChange={e => this.setState({ txt: e.target.value })}
onKeyDown={e => this.onKeyDown(e)}