Revision 984cd6a6
Added by Ron Lavi about 5 years ago
webpack/assets/javascripts/react_app/components/AutoComplete/AutoComplete.js | ||
---|---|---|
getResults: noop,
|
||
resetData: noop,
|
||
initialUpdate: noop,
|
||
useKeyShortcuts: true,
|
||
useKeyShortcuts: false,
|
||
placeholder: 'Filter ...',
|
||
url: null,
|
||
};
|
webpack/assets/javascripts/react_app/components/AutoComplete/__tests__/AutoComplete.test.js | ||
---|---|---|
|
||
it('pressing "forward-slash" should trigger focus', () => {
|
||
const props = getProps();
|
||
const component = mount(<AutoComplete {...props} />);
|
||
const component = mount(<AutoComplete {...props} useKeyShortcuts />);
|
||
const instance = component.instance();
|
||
const typeahead = instance._typeahead.current.getInstance();
|
||
typeahead.focus = jest.fn();
|
webpack/assets/javascripts/react_app/components/AutoComplete/__tests__/__snapshots__/AutoComplete.test.js.snap | ||
---|---|---|
ignoreDiacritics={true}
|
||
inputProps={
|
||
Object {
|
||
"className": "search-input use-shortcuts",
|
||
"className": "search-input",
|
||
"data-autocomplete-id": "some-id",
|
||
"spellCheck": "false",
|
||
}
|
||
... | ... | |
onClear={[Function]}
|
||
/>
|
||
<AutoCompleteFocusShortcut
|
||
useKeyShortcuts={true}
|
||
useKeyShortcuts={false}
|
||
/>
|
||
<AutoCompleteError
|
||
error={null}
|
webpack/assets/javascripts/react_app/components/AutoComplete/components/AutoCompleteFocusShortcut.js | ||
---|---|---|
};
|
||
|
||
AutoCompleteFocusShortcut.defaultProps = {
|
||
useKeyShortcuts: true,
|
||
useKeyShortcuts: false,
|
||
};
|
||
|
||
export default AutoCompleteFocusShortcut;
|
webpack/assets/javascripts/react_app/components/SearchBar/SearchBar.fixtures.js | ||
---|---|---|
searchQuery: null,
|
||
url: 'model/auto_complete_search',
|
||
id: 'some-id',
|
||
useKeyShortcuts: true,
|
||
},
|
||
bookmarks: {
|
||
url: '/api/bookmarks',
|
webpack/assets/javascripts/react_app/components/SearchBar/__tests__/__snapshots__/SearchBar.test.js.snap | ||
---|---|---|
id="some-id"
|
||
initialQuery=""
|
||
url="model/auto_complete_search"
|
||
useKeyShortcuts={true}
|
||
/>
|
||
<div
|
||
className="input-group-btn"
|
webpack/assets/javascripts/react_app/pages/common/PageLayout/__snapshots__/PageLayout.test.js.snap | ||
---|---|---|
"id": "some-id",
|
||
"searchQuery": null,
|
||
"url": "model/auto_complete_search",
|
||
"useKeyShortcuts": true,
|
||
},
|
||
"bookmarks": Object {
|
||
"canCreate": true,
|
||
... | ... | |
"id": "some-id",
|
||
"searchQuery": null,
|
||
"url": "model/auto_complete_search",
|
||
"useKeyShortcuts": true,
|
||
},
|
||
"bookmarks": Object {
|
||
"canCreate": true,
|
||
... | ... | |
"id": "some-id",
|
||
"searchQuery": null,
|
||
"url": "model/auto_complete_search",
|
||
"useKeyShortcuts": true,
|
||
},
|
||
"bookmarks": Object {
|
||
"canCreate": true,
|
||
... | ... | |
"id": "some-id",
|
||
"searchQuery": null,
|
||
"url": "model/auto_complete_search",
|
||
"useKeyShortcuts": true,
|
||
},
|
||
"bookmarks": Object {
|
||
"canCreate": true,
|
||
... | ... | |
"id": "some-id",
|
||
"searchQuery": null,
|
||
"url": "model/auto_complete_search",
|
||
"useKeyShortcuts": true,
|
||
},
|
||
"bookmarks": Object {
|
||
"canCreate": true,
|
Also available in: Unified diff
Fixes #26452 - default disable autocomplete key shortcuts