Skip to content

Commit

Permalink
Merge 5060e9b into 9d8bcb6
Browse files Browse the repository at this point in the history
  • Loading branch information
NickColley committed Jan 23, 2020
2 parents 9d8bcb6 + 5060e9b commit b931d3b
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 15 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,7 +2,10 @@

## Unreleased

### Fixes

- [Pull request #388: Set aria-selected as a string instead of a boolean to avoid being dropped.](https://github.com/alphagov/accessible-autocomplete/pull/388)
- [Pull request #400: Remove pointer events check](https://github.com/alphagov/accessible-autocomplete/pull/400)
- [Pull request #406: Make hint padding match input padding](https://github.com/alphagov/accessible-autocomplete/pull/406)

## 2.0.1 - 2019-10-07
Expand Down
2 changes: 1 addition & 1 deletion dist/accessible-autocomplete.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/accessible-autocomplete.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/accessible-autocomplete.preact.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/accessible-autocomplete.preact.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/accessible-autocomplete.react.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib/accessible-autocomplete.react.min.js.map

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions src/autocomplete.js
Expand Up @@ -13,13 +13,6 @@ const keyCodes = {
40: 'down'
}

// Based on https://github.com/ausi/Feature-detection-technique-for-pointer-events
const hasPointerEvents = (() => {
const element = document.createElement('x')
element.style.cssText = 'pointer-events:auto'
return element.style.pointerEvents === 'auto'
})()

function isIosDevice () {
return !!(navigator.userAgent.match(/(iPod|iPhone|iPad)/g) && navigator.userAgent.match(/AppleWebKit/g))
}
Expand Down Expand Up @@ -453,7 +446,6 @@ export default class Autocomplete extends Component {
const hintValue = (optionBeginsWithQuery && autoselect)
? query + selectedOptionText.substr(query.length)
: ''
const showHint = hasPointerEvents && hintValue

const assistiveHintID = id + '__assistiveHint'
const ariaDescribedProp = (ariaHint) ? {
Expand Down Expand Up @@ -489,7 +481,7 @@ export default class Autocomplete extends Component {
tResults={tStatusResults}
/>

{showHint && (
{hintValue && (
<span><input className={hintClassName} readonly tabIndex='-1' value={hintValue} /></span>
)}

Expand Down

0 comments on commit b931d3b

Please sign in to comment.