From 75dcaa2694da2aaa681aff1be74b2c0f3fab4028 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 17 Jun 2018 20:48:06 -0700 Subject: [PATCH] Add solve for dimmer to prevent modal scrolling in bg --- RELEASE-NOTES.md | 10 +++++++--- src/definitions/modules/dimmer.js | 10 ++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 642b1b58e..8ac8380f5 100755 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -3,14 +3,18 @@ ### Version 2.3.2 - June 17, 2018 **Enhancements** +- **Modal** - Modal and Dimmer now prevent background page from scrolling on mobile or where touch events are present +- **Button** - Add `inverted` and `inverted basic` variations for `primary` and `secondary` buttons **Thanks @hammy2899** [#6242](https://github.com/Semantic-Org/Semantic-UI/pull/6424) + +**Theming** - **Global** - Add `hover` `down` `active` and `focus` variables for `invertedPrimaryColor` and `invertedSecondaryColor` -- **Button** - Add `inverted` and `inverted basic` variations for `primary` and `secondary` buttons **Thanks @hammy2899** #6242 **Bugs** +- **Dropdown** Fixed bug that could cause dropdown to recursively trigger network requests specifically when using `apiSettings` with a url that returns valid response but with no results when clicking directly on the `dropdown icon`. **Thanks @vpeti** [#5231 [#5809](https://github.com/Semantic-Org/Semantic-UI/pull/6424) - **Statistics** - Fix issue where grouped statistics would have excess bottom margin if they are `:last-child` - **Label** - Fix `basic label` does not use `@basicBackground` variables **Thanks @levithomson** -- **Modal** - Modal will not refocus a field if field is already focused **Thanks @nikolaybobrovskiy** #6301 -- **Icon** - Fix `wechat icon` not displaying due to typo **Thanks @alex-karo** #6429 +- **Modal** - Modal will not refocus a field if field is already focused **Thanks @nikolaybobrovskiy** [#6301](https://github.com/Semantic-Org/Semantic-UI/pull/6424) +- **Icon** - Fix `wechat icon` not displaying due to typo **Thanks @alex-karo** [#6429](https://github.com/Semantic-Org/Semantic-UI/pull/6424) ### Version 2.3.1 - Mar 18, 2018 diff --git a/src/definitions/modules/dimmer.js b/src/definitions/modules/dimmer.js index 86bf308db..bdfc39abb 100755 --- a/src/definitions/modules/dimmer.js +++ b/src/definitions/modules/dimmer.js @@ -114,6 +114,10 @@ $.fn.dimmer = function(parameters) { bind: { events: function() { + if(module.is.page()) { + // touch events default to passive, due to changes in chrome to optimize mobile perf + $dimmable.get(0).addEventListener('touchmove', module.event.preventScroll, { passive: false }); + } if(settings.on == 'hover') { $dimmable .on('mouseenter' + eventNamespace, module.show) @@ -141,6 +145,9 @@ $.fn.dimmer = function(parameters) { unbind: { events: function() { + if(module.is.page()) { + $dimmable.get(0).removeEventListener('touchmove', module.event.preventScroll, { passive: false }); + } $module .removeData(moduleNamespace) ; @@ -157,6 +164,9 @@ $.fn.dimmer = function(parameters) { module.hide(); event.stopImmediatePropagation(); } + }, + preventScroll: function(event) { + event.preventDefault(); } },