From af67f02da2ae5836be05f4f34a14a468ac54e7df Mon Sep 17 00:00:00 2001 From: Sebastian Castro Date: Tue, 28 Apr 2020 15:25:03 +0200 Subject: [PATCH] select: remove nice-select for safari because of a known bug with fixed position and overflow Make the safari select looks the same than for other browser Only the dropdown will be different --- src/static/css/pad/form.css | 3 --- src/static/js/pad_editbar.js | 11 ++++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/static/css/pad/form.css b/src/static/css/pad/form.css index d0dcb7596..9b602d629 100644 --- a/src/static/css/pad/form.css +++ b/src/static/css/pad/form.css @@ -32,9 +32,6 @@ select, .nice-select { .nice-select:hover { border-color: #dbdbdb; } -.nice-select:active,.nice-select.open,.nice-select:focus { - /*border-color: #999;*/ -} .nice-select:after { border-bottom: 2px solid #999; border-right: 2px solid #999; diff --git a/src/static/js/pad_editbar.js b/src/static/js/pad_editbar.js index 04660e88a..df5833364 100644 --- a/src/static/js/pad_editbar.js +++ b/src/static/js/pad_editbar.js @@ -20,6 +20,7 @@ * limitations under the License. */ +var browser = require('./browser'); var hooks = require('./pluginfw/hooks'); var padutils = require('./pad_utils').padutils; var padeditor = require('./pad_editor').padeditor; @@ -170,7 +171,15 @@ var padeditbar = (function() ace: padeditor.ace }); - $('select').niceSelect(); + /* + * On safari, the dropdown in the toolbar gets hidden because of toolbar + * overflow:hidden property. This is a bug from Safari: any children with + * position:fixed (like the dropdown) should be displayed no matter + * overflow:hidden on parent + */ + if (!browser.safari) { + $('select').niceSelect(); + } // When editor is scrolled, we add a class to style the editbar differently $('iframe[name="ace_outer"]').contents().scroll(function() {