Merge pull request #3287 from urbit/mp/omnibox-fixes

leap: small fixes
This commit is contained in:
matildepark 2020-08-11 16:54:19 -04:00 committed by GitHub
commit 273bc9c0f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 4 deletions

View File

@ -4,7 +4,7 @@
<title>OS1</title>
<meta charset="utf-8" />
<meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
content="width=device-width, initial-scale=1, shrink-to-fit=no,maximum-scale=1"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />

View File

@ -68,6 +68,7 @@ export class Omnibox extends Component {
}
if (evt.key === 'Enter') {
evt.preventDefault();
if (this.state.selected !== '') {
this.navigate(this.state.selected);
} else {
@ -103,7 +104,7 @@ export class Omnibox extends Component {
search(event) {
const { state } = this;
const query = event.target.value;
let query = event.target.value;
const results = this.initialResults();
this.setState({ query: query });
@ -119,6 +120,8 @@ export class Omnibox extends Component {
return;
}
query = query.toLowerCase();
['commands', 'subscriptions', 'groups', 'apps'].map((category) => {
const categoryIndex = state.index.get(category);
results.set(category,
@ -189,7 +192,7 @@ export class Omnibox extends Component {
{categoryResult}
</Box>;
['commands', 'subscriptions', 'groups', 'apps'].map((category, i) => {
['apps', 'commands', 'groups', 'subscriptions'].map((category, i) => {
const categoryResults = state.results.get(category);
if (categoryResults.length > 0) {
const each = categoryResults.map((result, i) => {
@ -214,7 +217,7 @@ export class Omnibox extends Component {
return (
<Box
backgroundColor='lightGray'
backgroundColor='scales.black30'
width='100vw'
height='100vh'
position='absolute'

View File

@ -15,6 +15,7 @@ export class OmniboxInput extends Component {
placeholder='Search...'
onKeyDown={props.control}
onChange={props.search}
spellCheck={false}
value={props.query}
/>
);