mirror of
https://github.com/maunium/stickerpicker.git
synced 2025-02-06 23:35:33 +01:00
ignore autofocus issues on mobiles (disabled by design)
This commit is contained in:
parent
a197bda145
commit
e30535a975
@ -19,7 +19,6 @@ export function shouldAutofocusSearchBar() {
|
|||||||
return localStorage.mauAutofocusSearchBar === 'true'
|
return localStorage.mauAutofocusSearchBar === 'true'
|
||||||
}
|
}
|
||||||
|
|
||||||
const SEARCHBOX_CLASSNAME = 'search-box'
|
|
||||||
|
|
||||||
export class SearchBox extends Component {
|
export class SearchBox extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -34,14 +33,6 @@ export class SearchBox extends Component {
|
|||||||
this.clearSearch = this.clearSearch.bind(this)
|
this.clearSearch = this.clearSearch.bind(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
// required for firefox / webview usage in mobile clients
|
|
||||||
const inputInWebView = document.querySelector(`.${SEARCHBOX_CLASSNAME} input`)
|
|
||||||
if (inputInWebView && this.autofocus) {
|
|
||||||
setTimeout(() => inputInWebView.focus(), 100)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
componentWillReceiveProps(props) {
|
componentWillReceiveProps(props) {
|
||||||
this.value = props.value
|
this.value = props.value
|
||||||
}
|
}
|
||||||
@ -67,11 +58,12 @@ export class SearchBox extends Component {
|
|||||||
const iconToDisplay = `icon-${isEmpty ? 'search' : 'reset'}`
|
const iconToDisplay = `icon-${isEmpty ? 'search' : 'reset'}`
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div class=${SEARCHBOX_CLASSNAME}>
|
<div class="search-box">
|
||||||
<input
|
<input
|
||||||
placeholder="Find stickers …"
|
placeholder="Find stickers …"
|
||||||
value=${this.value}
|
value=${this.value}
|
||||||
onKeyUp=${this.search}
|
onKeyUp=${this.search}
|
||||||
|
autofocus=${this.autofocus}
|
||||||
/>
|
/>
|
||||||
<div class=${className} title=${title} onClick=${onClick}>
|
<div class=${className} title=${title} onClick=${onClick}>
|
||||||
<span class="icon ${iconToDisplay}" />
|
<span class="icon ${iconToDisplay}" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user