Skip to content

First character or paste is not accepted for watch when assigning placeholder to "" in <textarea> tag with IE11 #9042

Closed
@steelcg

Description

@steelcg

Version

2.5.17

Reproduction link

https://codepen.io/steelcg/pen/rQxqXN

Steps to reproduce

<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <textarea rows="10" v-model="projectName" placeholder=""></textarea>
        <!-- <input type="text" v-model="projectName" placeholder=""> -->
        <button @click="search">click</button>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                projectName: ""
            },
            methods: {
                search: function () {
                    alert(this.projectName == "");
                }
            }
        });
    </script>
</body>

</html>

key in one character such as "a" or paste a word and click search button in IE11, then you will get alert(true). But if you remove the placeholder attr, you will get false.

What is expected?

alert "false"

What is actually happening?

alert "true"


Because code.io is not supported in IE11, please manually type the code to reproduct the issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions