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

Input types in IE #1209

Closed
zzolo opened this issue Mar 6, 2018 · 0 comments
Closed

Input types in IE #1209

zzolo opened this issue Mar 6, 2018 · 0 comments
Labels

Comments

@zzolo
Copy link

zzolo commented Mar 6, 2018

The way Svelte creates inputs that are not supported in IE throws an 'Invalid argument' error.

Example:
https://svelte.technology/repl?version=1.56.2&gist=fa8724f2cbebbcf391e3184b0bc5c39c

I have a hard time finding some good docs on this, but here are some similar issues:
emberjs/ember.js#10458
angular/angular#16575

I have seen this in IE11 but have not checked other versions of IE.

What I have found is that the method Svelte uses to set the type throws an error:

input.type = 'date';

But, if you use the setAttribute, that seems to work. For instance, my workaround is this:

  oncreate: function() {
    if (this.get('isIE')) {
      this.refs.dateInput.setAttribute('type', 'date');
    }
  }

Note that though IE doesn't support the date type, there are polyfills/shims that will work around it, hence the need to have the attribute correct.

I am not sure the repercussions of switching to setAttribute, but I am not necessarily convinced that this is a problem Svelte needs to solve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants