mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 14:57:18 +10:00
Add autoFocus to wizard input fields
This commit is contained in:
parent
e418bb1590
commit
aa538a2eae
8 changed files with 12 additions and 3 deletions
|
|
@ -45,7 +45,7 @@ const LocationPredictionsList = props => {
|
|||
);
|
||||
};
|
||||
|
||||
const { shape, string, arrayOf, func, any, number } = PropTypes;
|
||||
const { bool, shape, string, arrayOf, func, any, number } = PropTypes;
|
||||
|
||||
LocationPredictionsList.defaultProps = { highlightedIndex: null };
|
||||
|
||||
|
|
@ -269,7 +269,7 @@ class LocationAutocompleteInput extends Component {
|
|||
});
|
||||
}
|
||||
render() {
|
||||
const { className, placeholder, input } = this.props;
|
||||
const { autoFocus, className, placeholder, input } = this.props;
|
||||
const { name, onFocus, onBlur } = input;
|
||||
const { search, predictions } = currentValue(this.props);
|
||||
|
||||
|
|
@ -300,6 +300,7 @@ class LocationAutocompleteInput extends Component {
|
|||
className={classNames(css.input, className)}
|
||||
type="search"
|
||||
autoComplete="off"
|
||||
autoFocus={autoFocus}
|
||||
placeholder={placeholder}
|
||||
name={name}
|
||||
value={search}
|
||||
|
|
@ -325,9 +326,10 @@ class LocationAutocompleteInput extends Component {
|
|||
}
|
||||
}
|
||||
|
||||
LocationAutocompleteInput.defaultProps = { className: '', placeholder: '' };
|
||||
LocationAutocompleteInput.defaultProps = { autoFocus: false, className: '', placeholder: '' };
|
||||
|
||||
LocationAutocompleteInput.propTypes = {
|
||||
autoFocus: bool,
|
||||
className: string,
|
||||
placeholder: string,
|
||||
input: shape({
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ export class EditListingDescriptionFormComponent extends Component {
|
|||
return (
|
||||
<form onSubmit={handleSubmit}>
|
||||
<Field
|
||||
autoFocus
|
||||
name="title"
|
||||
label={titleMessage}
|
||||
placeholder={titlePlaceholderMessage}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ exports[`EditListingDescriptionForm matches snapshot 1`] = `
|
|||
Name of your sauna
|
||||
</label>
|
||||
<input
|
||||
autoFocus={true}
|
||||
className=""
|
||||
name="title"
|
||||
onBlur={[Function]}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ export class EditListingLocationFormComponent extends Component {
|
|||
return (
|
||||
<form onSubmit={handleSubmit}>
|
||||
<Field
|
||||
autoFocus
|
||||
name="location"
|
||||
label={titleRequiredMessage}
|
||||
format={null}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ exports[`EditListingLocationForm matches snapshot 1`] = `
|
|||
<form
|
||||
onSubmit={[Function]}>
|
||||
<Field
|
||||
autoFocus={true}
|
||||
component={[Function]}
|
||||
format={null}
|
||||
label="EditListingLocationForm.location"
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ export class EditListingPricingFormComponent extends Component {
|
|||
<form onSubmit={handleSubmit}>
|
||||
<div className={css.priceWrapper}>
|
||||
<Field
|
||||
autoFocus
|
||||
name="price"
|
||||
component={this.EnhancedCurrencyInput}
|
||||
currencyConfig={config.currencyConfig}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ exports[`EditListingPricingForm matches snapshot 1`] = `
|
|||
<div
|
||||
className="">
|
||||
<input
|
||||
autoFocus={true}
|
||||
className=""
|
||||
label={null}
|
||||
onBlur={[Function]}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ exports[`SearchForm matches snapshot 1`] = `
|
|||
className={undefined}>
|
||||
<input
|
||||
autoComplete="off"
|
||||
autoFocus={false}
|
||||
className=""
|
||||
name="location"
|
||||
onBlur={[Function]}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue