diff --git a/src/.env.local.js.example b/src/.env.local.js.example index f6015dd..2da4d1f 100644 --- a/src/.env.local.js.example +++ b/src/.env.local.js.example @@ -46,11 +46,11 @@ module.exports = { // 'ds_federated_date', // 'sm_federated_terms', // ], - // OPTIONAL: Provides config for adding autocomplete functionality to text search + // OPTIONAL: Provides config for adding autocomplete functionality to text search, defaults to false // autocomplete : { // url: , // required @todo document accepted types - // queryField: 'tem_suggestion_title', // REQUIRED - // suggestionRows: 5, // REQUIRED: no current default set + // appendWildcard: true, // OPTIONAL: defaults to false, whether or not to append wildcard to query term + // suggestionRows: 5, // OPTIONAL: defaults to 5 // numChars: 2, // OPTIONAL: defaults to 2, number of characters *after* which autocomplete results should appear // mode: 'result', // REQUIRED: show search-as-you-type results ('result', default) or search term ('term') suggestions // result: { // OPTIONAL: define result based autocomplete-specific config @@ -59,7 +59,7 @@ module.exports = { // }, // term: { // OPTIONAL: define term based autocomplete-specific config // titleText: 'What would you like to search for?', // OPTIONAL: default set - // showDirectionsText: true, // OPTIONAL: defaults to false + // showDirectionsText: false, // OPTIONAL: defaults to true // }, // }, }; diff --git a/src/components/text-search/search-as-you-type.js b/src/components/text-search/search-as-you-type.js index 4f499e9..4e47830 100644 --- a/src/components/text-search/search-as-you-type.js +++ b/src/components/text-search/search-as-you-type.js @@ -178,14 +178,14 @@ class FederatedTextSearchAsYouType extends React.Component { ? this.props.autocomplete.result.titleText : 'What are you looking for?'; const resultShowDirectionsText = hasResultModeConfig - && this.props.autocomplete.result.showDirectionsText + && Object.hasOwnProperty.call(this.props.autocomplete.result, 'showDirectionsText') ? this.props.autocomplete.result.showDirectionsText : true; const termTitleText = hasTermModeConfig && this.props.autocomplete.term.titleText ? this.props.autocomplete.term.titleText : 'Suggested search terms'; const termShowDirectionsText = hasTermModeConfig - && this.props.autocomplete.term.showDirectionsText + && Object.hasOwnProperty.call(this.props.autocomplete.term, 'showDirectionsText') ? this.props.autocomplete.term.showDirectionsText : true; diff --git a/yarn.lock b/yarn.lock index 80df6dd..d375252 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7410,7 +7410,7 @@ sockjs@0.3.18: "solr-faceted-search-react@git+ssh://git@github.com:palantirnet/solr-faceted-search-react#root-138-autocomplete": version "0.12.1" - resolved "git+ssh://git@github.com:palantirnet/solr-faceted-search-react#82eb9366e0650b43be57565139da296ffc62e565" + resolved "git+ssh://git@github.com:palantirnet/solr-faceted-search-react#f0df9079a3a0e56d866ff2640c780decc645617a" dependencies: classnames "^2.2.5" prop-types "^15.6.1"