Skip to content

Commit

Permalink
fix(range): tap and range styles for Edge. Fixes #3853
Browse files Browse the repository at this point in the history
  • Loading branch information
mlynch committed Dec 8, 2015
1 parent 0522863 commit 4ee8678
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
11 changes: 11 additions & 0 deletions js/utils/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
var IOS = 'ios';
var ANDROID = 'android';
var WINDOWS_PHONE = 'windowsphone';
var EDGE = 'edge';
var requestAnimationFrame = ionic.requestAnimationFrame;

/**
Expand Down Expand Up @@ -229,6 +230,14 @@
isWindowsPhone: function() {
return self.is(WINDOWS_PHONE);
},
/**
* @ngdoc method
* @name ionic.Platform#isEdge
* @returns {boolean} Whether we are running on MS Edge/Windows 10 (inc. Phone)
*/
isEdge: function() {
return self.is(EDGE);
},

/**
* @ngdoc method
Expand All @@ -249,6 +258,8 @@
platformName = n.toLowerCase();
} else if (getParameterByName('ionicplatform')) {
platformName = getParameterByName('ionicplatform');
} else if (self.ua.indexOf('Edge') > -1) {
platformName = EDGE;
} else if (self.ua.indexOf('Windows Phone') > -1) {
platformName = WINDOWS_PHONE;
} else if (self.ua.indexOf('Android') > 0) {
Expand Down
3 changes: 2 additions & 1 deletion js/utils/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ function tapMouseDown(e) {
console.log('mousedown', 'stop event');
e.stopPropagation();

if ((!ionic.tap.isTextInput(e.target) || tapLastTouchTarget !== e.target) && !isSelectOrOption(e.target.tagName) && !ionic.tap.isVideo(e.target)) {
if (!ionic.Platform.isEdge() && (!ionic.tap.isTextInput(e.target) || tapLastTouchTarget !== e.target) &&
!isSelectOrOption(e.target.tagName) && !ionic.tap.isVideo(e.target)) {
// If you preventDefault on a text input then you cannot move its text caret/cursor.
// Allow through only the text input default. However, without preventDefault on an
// input the 300ms delay can change focus on inputs after the keyboard shows up.
Expand Down
14 changes: 8 additions & 6 deletions scss/_range.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
background-size: 99% $range-track-height;
background-repeat: no-repeat;
-webkit-appearance: none;

&::-moz-focus-outer {
/* hide the focus outline in Firefox */
border: 0;
border: 0;
}

&::-webkit-slider-thumb {
Expand Down Expand Up @@ -59,6 +59,11 @@
//background: red;
//opacity: .5;
}
&::-ms-fill-lower{
height: $range-track-height;
background:$dark;
}
/*
&::-ms-track{
background: transparent;
border-color: transparent;
Expand All @@ -77,14 +82,11 @@
margin-right:1px;
outline:none;
}
&::-ms-fill-lower{
height: $range-track-height;
background:$dark;
}
&::-ms-fill-upper {
height: $range-track-height;
background:$range-default-track-bg;
}
*/
}

.range {
Expand Down

0 comments on commit 4ee8678

Please sign in to comment.