question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

:style with multiline attribute removes root element in all versions of IE

See original GitHub issue

Vue.js version

2.0.0-rc5

Browser

Internet Explorer 10 Microsoft Edge

Reproduction Link

http://danieldiekmeier.de/vue/1.html // This one doesn’t show anything http://danieldiekmeier.de/vue/2.html // This one shows “Hello” in Red, as expected

Steps to reproduce

This is the HTML that does not work:

<div id="app">
  <div
    :style="{
      'color': 'red'
    }"
  >
    Hello
  </div>
</div>

This is the HTML that does work:

<div id="app">
  <div
    :style="{'color': 'red'}"
  >
    Hello
  </div>
</div>

This is the JavaScript:

new Vue({
  el: '#app'
})

What is Expected?

image

No matter if I enter the :style attribute in multiple lines or not, it should always work the same. (It also works in both cases if I use Vue v1). In Chrome and Firefox, both versions are working.

What is actually happening?

image

(Here you can see the #app div completely missing in the DOM tree.)

When using IE (11, in my case) or Edge, the whole root element (#app) gets completely thrown out of the DOM as soon as Vue starts rendering. This happens regardless of emulated document mode (Edge, 10, 9 all behave the same).

(I was not able to reproduce this bug in a JSFiddle, even when using exactly this code. But in the examples above, it does happen). Here is the fiddle: https://jsfiddle.net/gzd6o9ob/4/

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jakelauercommented, Aug 3, 2017

This is happening for me using Edge, Vue v2.4.2

0reactions
posvacommented, Sep 12, 2016

Oh, didn’t know it worked on the previous version. Vue 2 is rewritten from scratch and uses Virtual dom to parse templates. Maybe Vue 1 actually handled that. Can this be fixed easily for Vue 2 @yyx990803 ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

appearance - CSS: Cascading Style Sheets - MDN Web Docs
The appearance CSS property is used to control native appearance of UI controls, that are based on operating system's theme.
Read more >
3.2 Elements — HTML5 - W3C
Documents that use style attributes on any of their elements must still be comprehensible and usable if those attributes were removed. In particular,...
Read more >
appearance - CSS-Tricks
The appearance property is used to display an element using a ... If you don't want that styling, you can remove it in...
Read more >
Adjacent JSX elements must be wrapped in an enclosing tag ...
The other people here are just telling you to use a parent element, but that may be unnecessary. This older version of your...
Read more >
HTML and CSS Tutorial - Nanyang Technological University
Be aware of the Intellectual Property Right, do not use any images or ... note that NOT all browsers (notably older IE versions)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found