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 type file is changed to text in Safari #5266

Closed
thbwd opened this issue Mar 23, 2017 · 1 comment
Closed

Input type file is changed to text in Safari #5266

thbwd opened this issue Mar 23, 2017 · 1 comment
Labels

Comments

@thbwd
Copy link

thbwd commented Mar 23, 2017

Version

2.2.4

Reproduction link

http://codepen.io/idmean/pen/MpXapy

Steps to reproduce

<div id="app">
  <div v-if="enterUser">
    <input type="text" v-model="user">
  </div>
  <div v-if="!enterUser">
    <h1>file</h1>
    <input type="file">
  </div>
</div>

JS:

const app1 = new Vue({
  el: '#app',
  data: {
    enterUser: true,
    user: 'sean',
  }
});

setTimeout(() => app1.enterUser = false, 1000);

Wait one second for the timeout to expire and the views to change.

What is expected?

The second view consisting of the heading "file" and a file input should appear.

What is actually happening?

A text input appears instead. Inspecting the DOM also shows a input element with type text was created.


This bug seems to occur only in Safari (10.0.3)

@posva
Copy link
Member

posva commented Mar 23, 2017

Hey, thanks for opening the issue. There's something off indeed.
You can fix it by using a key attr in the file input like key="file"

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

No branches or pull requests

2 participants