Moved search components our of src/ folder. (#7869)
This commit is contained in:
parent
2daac8a216
commit
26cf4085fc
9 changed files with 9 additions and 9 deletions
|
|
@ -6,7 +6,7 @@ import {
|
|||
hasInstantClick,
|
||||
preloadSearchResults,
|
||||
displaySearchResults,
|
||||
} from '../../utils/search';
|
||||
} from '../src/utils/search';
|
||||
import { SearchForm } from './SearchForm';
|
||||
|
||||
const GLOBAL_MINIMIZE_KEY = '0';
|
||||
|
|
@ -57,11 +57,11 @@ export class Search extends Component {
|
|||
this.enableSearchPageChecker = true;
|
||||
};
|
||||
|
||||
hasKeyModifiers = event => {
|
||||
hasKeyModifiers = (event) => {
|
||||
return event.altKey || event.ctrlKey || event.metaKey || event.shiftKey;
|
||||
};
|
||||
|
||||
search = event => {
|
||||
search = (event) => {
|
||||
const {
|
||||
key,
|
||||
target: { value },
|
||||
|
|
@ -77,7 +77,7 @@ export class Search extends Component {
|
|||
}
|
||||
};
|
||||
|
||||
submit = event => {
|
||||
submit = (event) => {
|
||||
if (hasInstantClick) {
|
||||
event.preventDefault();
|
||||
|
||||
|
|
@ -95,7 +95,7 @@ export class Search extends Component {
|
|||
const { searchBoxId } = this.props;
|
||||
const searchBox = document.getElementById(searchBoxId);
|
||||
|
||||
this.globalKeysListener = event => {
|
||||
this.globalKeysListener = (event) => {
|
||||
const { tagName, classList } = document.activeElement;
|
||||
|
||||
if (
|
||||
|
|
@ -6,7 +6,7 @@ import { SearchForm } from '..';
|
|||
const commonProps = {
|
||||
searchBoxId: 'nav-search',
|
||||
onSearch: action('on preloading search'),
|
||||
onSubmitSearch: e => {
|
||||
onSubmitSearch: (e) => {
|
||||
e.preventDefault();
|
||||
action('on submit')(e);
|
||||
},
|
||||
|
|
@ -4,7 +4,7 @@ import { Search } from '../Search';
|
|||
|
||||
describe('<Search />', () => {
|
||||
beforeEach(() => {
|
||||
global.filterXSS = x => x;
|
||||
global.filterXSS = (x) => x;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import { h, render } from 'preact';
|
||||
import { Search } from '../src/components/Search';
|
||||
import 'focus-visible'
|
||||
import { Search } from '../Search';
|
||||
import 'focus-visible';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const root = document.getElementById('top-bar--search');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue