47ea57080b515e5dad5f658c58feb8944a7e7d61 chmalee Thu Jan 29 15:30:26 2026 -0800 Replace clade/assembly dropdowns with a search bar on most CGIs. Add a recents list to hgGateway and to the species bar and to the 'Genomes' dropdown menu. Track recently selected species in localStorage. Add toGenome and fromGenome arguemnts to hubApi/liftOver in order to find appropriate liftover assemblies, refs #36232 diff --git src/hg/js/react/lib/TextInput.jsx src/hg/js/react/lib/TextInput.jsx index 630db8d7060..778598b0c4b 100644 --- src/hg/js/react/lib/TextInput.jsx +++ src/hg/js/react/lib/TextInput.jsx @@ -1,66 +1,68 @@ /** @jsx React.DOM */ /* global ImmutableUpdate, PathUpdate */ var pt = React.PropTypes; var ENTER_KEY = 13; var TextInput = React.createClass({ // Text input that keeps local state while user is typing. mixins: [PathUpdate, ImmutableUpdate], // update(path, value) called when user finishes changing value propTypes: { // Optional value: pt.string, // initial value of text input (before user changes) ref: pt.string, // React ref handle for parent to invoke this.refs[ref] size: pt.number, // size attribute to pass on to input element - className: pt.string // class(es) to pass to input + className: pt.string, // class(es) to pass to input + placeholder: pt.string // placeholder value if any }, getInitialState: function() { return {value: this.props.value}; }, onBlur: function(e) { // When user is done changing the input, notify model. var newValue = e.target.value.trim(); newValue = newValue.replace(/\u2013|\u2014/g, '-'); if (newValue !== this.props.value) { this.props.update(this.props.path, newValue); } }, onKeyPress: function(e) { // Keep ordinary keypress updates local; notify parent only when user hits Enter. if (e.which === ENTER_KEY) { this.onBlur(e); } }, localOnChange: function(e) { // Update to reflect the user's keypress. var newValue = e.target.value; this.setState({value: newValue}); }, componentWillReceiveProps: function(nextProps) { // Update local state when a new value is handed down from above. // We can't do this during render because then the user's changes are ignored! if (this.state.value !== nextProps.value) { this.setState({value: nextProps.value}); } }, render: function() { return ( - ); } }); // Without this, jshint complains that TextInput is not used. Module system would help. TextInput = TextInput;