Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Input range => Frozen slider on Internet Explorer 11 #3853

Closed
JeanMeche opened this issue May 28, 2015 · 9 comments
Closed

bug: Input range => Frozen slider on Internet Explorer 11 #3853

JeanMeche opened this issue May 28, 2015 · 9 comments
Assignees
Milestone

Comments

@JeanMeche
Copy link

Type: bug

Platform: desktop browser

Here is a demo : http://codepen.io/anon/pen/OPdJRq

@JeanMeche JeanMeche changed the title Bug : Input range => Frozen slider on Internet Explorer 11 bug: Bug : Input range => Frozen slider on Internet Explorer 11 May 28, 2015
@JeanMeche JeanMeche changed the title bug: Bug : Input range => Frozen slider on Internet Explorer 11 bug: Input range => Frozen slider on Internet Explorer 11 May 28, 2015
@mhartington mhartington added this to the 1.1 milestone May 29, 2015
@mhartington
Copy link
Contributor

Hmm, it works on a touch screen, so this maybe related to touch/pointer events

@bitflower
Copy link
Contributor

It also works with the keyboard cursor keys (after selecting the range with the mouse)

@bitflower
Copy link
Contributor

It works in IE11 when we remove the e.preventDefault(); inside tapMouseDown (talking ionic.bundle.js).

The question is if this is better targetted with IE 11 in mind or with type=range in mind. If I understand correctly this function handles the focus of text fields and the keyboard being shown. So we could exclude the type=range here similiar to the select|option exclude in the if:

if ((!ionic.tap.isTextInput(e.target) || tapLastTouchTarget !== e.target) && !(/^(select|option)$/i).test(e.target.tagName)) {
      e.preventDefault();
}

EDIT: I added another condition to the if and it works. The question to @mhartington is: Is this the right place to handle this or would it be one more step before where tapEnabledTouchEvents has a different value in IE11 than in other browsers.

Workaround:
if ((!ionic.tap.isTextInput(e.target) || tapLastTouchTarget !== e.target) && !(/^(select|option)$/i).test(e.target.tagName) && e.target.type !== 'range') {
// 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.
// The focusin event handles the chance of focus changing after the keyboard shows.
e.preventDefault();
}

If you think this is right I can prepare a PR.

@mhartington
Copy link
Contributor

I'm going to let @perrygovier Take a look at this. He's been working scrolling/touch events so he'd know best

@mhartington mhartington modified the milestones: 1.1, 1.2 Aug 15, 2015
@anubhavgupta
Copy link

I am also facing the same issue with range input on IE 11.
For the time being the only solution seams to be is to set element.contentEditable = true for the range input element.

@5im0n
Copy link
Contributor

5im0n commented Dec 4, 2015

The problem is also present in Edge 😣
Before waiting for the 1.2 milestone, the workaround of @anubhavgupta works great

<div class="item range">
  <i class="icon ion-volume-low"></i>
  <input type="range" name="volume" contenteditable="true">
  <i class="icon ion-volume-high"></i>
</div>

@mlynch
Copy link
Contributor

mlynch commented Dec 8, 2015

Okay, a few discoveries: First, we can't preventDefault in tapMouseDown if it's a range (at least on IE). However, range styles are totally borked in Edge, so that needs to be fixed as well.

@mlynch mlynch closed this as completed in 4ee8678 Dec 8, 2015
@mlynch
Copy link
Contributor

mlynch commented Dec 8, 2015

Should be fixed now, and range styles were fixed. Thanks!

@cmellinas
Copy link

Hi @mlynch,

When you say : 'we can't preventDefault in tapMouseDown if it's a range (at least on IE). '

I used the following workaround : https://forum.ionicframework.com/t/range-slider-not-movable-in-internet-explorer/19592/4

The fix was to only add && e.target.type !== 'range' at the end of the if condition

It's weird but the range works well on my computer on IE10 & IE11 only with this condition (even if I don't understand why the method isTextInput is bypassed by IE)

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants