chore(v2): remove docsearch a11y workaround

This commit is contained in:
endiliey 2019-05-13 22:19:31 +08:00
parent b61cab5e9b
commit ffdd3e60fc
3 changed files with 22 additions and 8 deletions

View file

@ -28,11 +28,6 @@ class Search extends React.Component {
// https://github.com/algolia/docsearch/issues/352
const isClient = typeof window !== 'undefined';
if (isClient) {
// Temporary workaround for a11y issue
// https://github.com/algolia/docsearch/issues/418#
const docsearchInput = document.querySelector('#search_input_react');
const ariaLabel = docsearchInput.getAttribute('aria-label');
import('docsearch.js').then(({default: docsearch}) => {
docsearch({
appId: algolia.appId,
@ -41,7 +36,6 @@ class Search extends React.Component {
inputSelector: '#search_input_react',
algoliaOptions: algolia.algoliaOptions,
});
docsearchInput.setAttribute('aria-label', ariaLabel);
});
} else {
console.warn('Search has failed to load and now is being disabled');