-
Notifications
You must be signed in to change notification settings - Fork 1
Ipad touch-away handling #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
closeButton = wrapper.find(CloseButton); | ||
}); | ||
|
||
it(`${React.version} - asdmatches the previous snapshot`, () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stuff is pretty much all just indentation changes, as I wrapped them in an extra describe
declaration.
); | ||
}); | ||
|
||
describe('touch devices -', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New tests start here
handleTouch = ({ target }: Event) => { | ||
const { activeElement } = document; | ||
|
||
if (!(activeElement instanceof Element) || !(target instanceof Element)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In acc-css-app
we're testing for instanceof HTMLElement
, but this would not catch HTMLBodyElement
for example. Element
is a bit of a broader net.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we going to apply this as well at line 70
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but it's a bit of a moot point because it's not possible for a label
component to be an HTMLBodyElement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. Fair enough.
}; | ||
|
||
hide = (): void => { | ||
hide = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is keeping void
a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason it breaks syntax highlighting in my IDE :(
It doesn't matter though because Flow will infer the return types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem found, just a few questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good!
Basically an upstream-retrofit of the logic from
acc-css-app
to add touch-away handling for iOS devices who don't actually trigger a 'blur' on focussed elements when touching-away from the element.