Prevent click tag filter input from closing tag list item

pull/10616/head
Brandon Farmer 2018-04-12 13:40:11 -07:00
parent 9ff9f63dd2
commit b23732a7a6
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
import PropTypes from 'prop-types'
import React, {PureComponent} from 'react'
import React, {PureComponent, ChangeEvent} from 'react'
import _ from 'lodash'
@ -80,7 +80,7 @@ class MeasurementList extends PureComponent<Props, State> {
this.getMeasurements()
}
public handleFilterText(e) {
public handleFilterText(e: ChangeEvent<HTMLInputElement>) {
e.stopPropagation()
const filterText = e.target.value
this.setState({

View File

@ -69,6 +69,10 @@ class TagListItem extends PureComponent<Props, State> {
this.props.onGroupByTag(this.props.tagKey)
}
public handleInputClick(e: MouseEvent<HTMLInputElement>) {
e.stopPropagation()
}
public renderTagValues() {
const {tagValues, selectedTagValues} = this.props
if (!tagValues || !tagValues.length) {
@ -88,6 +92,7 @@ class TagListItem extends PureComponent<Props, State> {
value={this.state.filterText}
onChange={this.handleFilterText}
onKeyUp={this.handleEscape}
onClick={this.handleInputClick}
spellCheck={false}
autoComplete="false"
/>