Skip to content

Commit

Permalink
fix firefox tags 'View Rules' bug (#5732) [deploy]
Browse files Browse the repository at this point in the history
  • Loading branch information
sunny-b authored and benhalpern committed Jan 27, 2020
1 parent d6cdedb commit a86ccff
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/javascript/shared/components/tags.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ class Tags extends Component {
let searchResultsHTML = '';
const { searchResults, selectedIndex, showingRulesForTag } = this.state;
const { classPrefix, defaultValue, maxTags, listing } = this.props;
const { activeElement } = document;
const searchResultsRows = searchResults.map((tag, index) => (
<div
tabIndex="-1"
Expand Down Expand Up @@ -411,9 +412,11 @@ class Tags extends Component {
));
if (
searchResults.length > 0 &&
(document.activeElement.id === 'tag-input' ||
document.activeElement.className ===
'articleform__tagsoptionrulesbutton')
(activeElement.id === 'tag-input' ||
activeElement.classList.contains(
'articleform__tagsoptionrulesbutton',
) ||
activeElement.classList.contains('articleform__tagoptionrow'))
) {
searchResultsHTML = (
<div className={`${classPrefix}__tagsoptions`}>
Expand Down

0 comments on commit a86ccff

Please sign in to comment.