Skip to content

Commit 4ee8678

Browse files
committed
fix(range): tap and range styles for Edge. Fixes #3853
1 parent 0522863 commit 4ee8678

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

Diff for: js/utils/platform.js

+11
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
var IOS = 'ios';
1111
var ANDROID = 'android';
1212
var WINDOWS_PHONE = 'windowsphone';
13+
var EDGE = 'edge';
1314
var requestAnimationFrame = ionic.requestAnimationFrame;
1415

1516
/**
@@ -229,6 +230,14 @@
229230
isWindowsPhone: function() {
230231
return self.is(WINDOWS_PHONE);
231232
},
233+
/**
234+
* @ngdoc method
235+
* @name ionic.Platform#isEdge
236+
* @returns {boolean} Whether we are running on MS Edge/Windows 10 (inc. Phone)
237+
*/
238+
isEdge: function() {
239+
return self.is(EDGE);
240+
},
232241

233242
/**
234243
* @ngdoc method
@@ -249,6 +258,8 @@
249258
platformName = n.toLowerCase();
250259
} else if (getParameterByName('ionicplatform')) {
251260
platformName = getParameterByName('ionicplatform');
261+
} else if (self.ua.indexOf('Edge') > -1) {
262+
platformName = EDGE;
252263
} else if (self.ua.indexOf('Windows Phone') > -1) {
253264
platformName = WINDOWS_PHONE;
254265
} else if (self.ua.indexOf('Android') > 0) {

Diff for: js/utils/tap.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,8 @@ function tapMouseDown(e) {
361361
console.log('mousedown', 'stop event');
362362
e.stopPropagation();
363363

364-
if ((!ionic.tap.isTextInput(e.target) || tapLastTouchTarget !== e.target) && !isSelectOrOption(e.target.tagName) && !ionic.tap.isVideo(e.target)) {
364+
if (!ionic.Platform.isEdge() && (!ionic.tap.isTextInput(e.target) || tapLastTouchTarget !== e.target) &&
365+
!isSelectOrOption(e.target.tagName) && !ionic.tap.isVideo(e.target)) {
365366
// If you preventDefault on a text input then you cannot move its text caret/cursor.
366367
// Allow through only the text input default. However, without preventDefault on an
367368
// input the 300ms delay can change focus on inputs after the keyboard shows up.

Diff for: scss/_range.scss

+8-6
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
background-size: 99% $range-track-height;
2121
background-repeat: no-repeat;
2222
-webkit-appearance: none;
23-
23+
2424
&::-moz-focus-outer {
2525
/* hide the focus outline in Firefox */
26-
border: 0;
26+
border: 0;
2727
}
2828

2929
&::-webkit-slider-thumb {
@@ -59,6 +59,11 @@
5959
//background: red;
6060
//opacity: .5;
6161
}
62+
&::-ms-fill-lower{
63+
height: $range-track-height;
64+
background:$dark;
65+
}
66+
/*
6267
&::-ms-track{
6368
background: transparent;
6469
border-color: transparent;
@@ -77,14 +82,11 @@
7782
margin-right:1px;
7883
outline:none;
7984
}
80-
&::-ms-fill-lower{
81-
height: $range-track-height;
82-
background:$dark;
83-
}
8485
&::-ms-fill-upper {
8586
height: $range-track-height;
8687
background:$range-default-track-bg;
8788
}
89+
*/
8890
}
8991

9092
.range {

0 commit comments

Comments
 (0)