Skip to content
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

Fixing sidebar not closing on outside content click issue #328

Merged
merged 2 commits into from
Mar 31, 2017

Conversation

sean-roberts
Copy link
Contributor

Fixes #252

Since click is not registered for elements without cursor: pointer we will listen for the touchstart in addition to the click event so we can get around this issue for mobile devices.

@codecov-io
Copy link

codecov-io commented Mar 30, 2017

Codecov Report

Merging #328 into master will increase coverage by 0.11%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #328      +/-   ##
==========================================
+ Coverage    76.6%   76.71%   +0.11%     
==========================================
  Files         120      120              
  Lines        5886     5889       +3     
  Branches      959      960       +1     
==========================================
+ Hits         4509     4518       +9     
+ Misses       1377     1371       -6
Impacted Files Coverage Δ
src/annotator/sidebar.coffee 79.74% <100%> (+8.69%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5060aca...b6741e5. Read the comment docs.

@@ -47,6 +47,16 @@ module.exports = class Sidebar extends Host
@element.on 'click', (event) =>
if !@selectedTargets?.length
this.hide()

# Mobile browsers do not register click events on
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that this restriction applied only to iOS but not to Android Chrome. This works either way.

Copy link
Member

@robertknight robertknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested on iOS Safari & Android Chrome. I added some tests.

@robertknight robertknight merged commit b82424e into master Mar 31, 2017
@robertknight robertknight deleted the mobile-tap-close branch March 31, 2017 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants