Skip to content

Commit

Permalink
Fix invalid search minScale passed to SearchBox through SoTopBar
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Jun 19, 2024
1 parent 8175517 commit 7625d80
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/plugins/SoTopBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,22 @@ class SoTopBar extends React.Component {
});
let searchComponent = null;
if (this.props.components.Search) {
// Convert legacy minScale option to minScaleDenom
const searchOptions = {...this.props.searchOptions};
searchOptions.minScaleDenom = searchOptions.minScaleDenom || searchOptions.minScale;
delete searchOptions.minScale;
if (this.props.mobile) {
const buttonClasses = classnames({
"sotopbar-search-button-active": this.state.mobileSearchVisible
});
searchComponent = [
(<button className={buttonClasses} key="SearchButton" onClick={() => this.toggleSearch()} type="button"><Icon icon="search" size="large" /></button>),
this.state.mobileSearchVisible ? (<div key="SearchField" className="sotopbar-mobile-searchfield">
<this.props.components.Search searchOptions={this.props.searchOptions}/>
<this.props.components.Search searchOptions={searchOptions}/>
</div>) : null
];
} else {
searchComponent = (<this.props.components.Search searchOptions={this.props.searchOptions}/>);
searchComponent = (<this.props.components.Search searchOptions={searchOptions}/>);
}
}
const bannerClasses = classnames({
Expand Down

0 comments on commit 7625d80

Please sign in to comment.