focus () { // focus the input slightly after dbl-click setTimeout(() => { const { refs: { input } } = this; input.focus(); }); }
submit(e) { const {_title, _color} = this.refs; e.preventDefault(); this.props.onNewColor(_title.value, _color.value); _title.value = ''; _color.value = ''; _title.focus(); }
insertAtCursor(myValue) { let input = this.refs.inputMessage; if (input.selectionStart || input.selectionStart === '0') { let startpos = input.selectionStart; let endpos = input.selectionEnd; let restore = input.scrollTop; input.value = input.value.substring(0, startpos) + myValue + input.value.substring(endpos, input.value.length); if (restoreTop > 0) { input.scrollTop = restoreTop; } input.focus(); input.selectionStart = startpos + myValue.length; input.selectionEnd = startpos + myValue.length; } else { input.value += myValue; input.focus(); } }
afterGuiAttached() { // get ref from React component const eInput = this.refs.input; eInput.focus(); if (this.state.highlightAllOnFocus) { eInput.select(); this.setState({ highlightAllOnFocus: false }); } else { // when we started editing, we want the carot at the end, not the start. // this comes into play in two scenarios: a) when user hits F2 and b) // when user hits a printable character, then on IE (and only IE) the carot // was placed after the first character, thus 'apply' would end up as 'pplea' const length = eInput.value ? eInput.value.length : 0; if (length > 0) { eInput.setSelectionRange(length, length); } } }
this.props.todosStore.addTodo(input.value); input.value = ""; input.focus();
submit(e) { const { _title, _color } = this.refs const { onNewColor } = this.props e.preventDefault() onNewColor(_title.value, _color.value) _title.value = '' _color.value = '#000000' _title.focus() }
this.props.dispatch(actions.addTodo(input.value)); input.value = ""; input.focus();
submit(e) { const {_title, _color} = this.refs; e.preventDefault(); this.props.onAddColor(_title.value, _color.value); _title.value = ''; _color.value = "#000000"; _title.focus(); }
submit(e) { const {_title, _color} = this.refs; e.preventDefault(); this.props.onNewColor(_title.value, _color.value); _title.value = ''; _color.value = ''; _title.focus(); }
submit(e) { const {_title, _color} = this.refs; e.preventDefault(); this.props.onNewColor(_title.value, _color.value); _title.value = ''; _color.value = "#000000"; _title.focus(); }
submit(e) { const {_title, _color} = this.refs; e.preventDefault(); this.props.onNewColor(_title.value, _color.value); _title.value = ''; _color.value = ''; _title.focus(); }
submit(e) { const {_title, _color} = this.refs; e.preventDefault(); this.props.onNewColor(_title.value, _color.value); _title.value = ''; _color.value = ''; _title.focus(); }
submit(e) { const {_title, _color} = this.refs; e.preventDefault(); this.props.onNewColor(_title.value, _color.value); _title.value = ''; _color.value = ''; _title.focus(); }
submit(e) { const {_title, _color} = this.refs; e.preventDefault(); this.props.onNewColor(_title.value, _color.value); _title.value = ''; _color.value = ''; _title.focus(); }
submit(e) { const { _title, _color } = this.refs const { onNewColor } = this.props e.preventDefault() onNewColor(_title.value, _color.value) _title.value = '' _color.value = '#000000' _title.focus() }