Skip to content

Commit

Permalink
Fix: Tooltips don’t close when clicked outside in iOS (fixes #90)
Browse files Browse the repository at this point in the history
In order for this to work, options.pagecontainer must be set.

The problem is that iOS needs cursor:pointer on the clicked element in order to register a click.

There are few options:

1. The best option is to set  `options.pagecontainer` and the plugin will fix the issue by adding `cursor:pointer` style to page container div. Page container div is also useful for some screen-readers and will be used in next implementation of `scrolllock` (see https://gist.github.com/vladimirsiljkovic/9674659f00f730ad8a14689e0115696c ).
2. Another option is to add `cursor:pointer` style manually on any div that is below the popup, however this will affect other browsers if iOS is not explicitly targeted.
3. Another option is to set `background:true` and `color:transparent` on tooltips to get show the transparent background div, however this will disable interaction with background content until popup is closed (first click would close the tooltip, so the second click would be required to interact with background content).
  • Loading branch information
vladimirsiljkovic committed Dec 10, 2018
1 parent 36a64d5 commit 81139df
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions jquery.popupoverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
if (iOS) {
$background = $('#' + el.id + '_background');
$background.css('cursor', 'pointer');
$(options.pagecontainer).css('cursor', 'pointer');
}

if (options.type == 'overlay' && !options.absolute) {
Expand Down

0 comments on commit 81139df

Please sign in to comment.