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

vbind:style does not work with zIndex #9382

Closed
blimmer opened this issue Jan 28, 2019 · 1 comment · Fixed by #9386
Closed

vbind:style does not work with zIndex #9382

blimmer opened this issue Jan 28, 2019 · 1 comment · Fixed by #9386
Labels

Comments

@blimmer
Copy link

blimmer commented Jan 28, 2019

Version

2.5.22

Reproduction link

https://codesandbox.io/s/rm36pyr37q

Steps to reproduce

Given a very simple component:

<template>
  <div v-bind:style="styleObject">This div should have a large z-index</div>
</template>

<script>
export default {
  name: "HelloWorld",
  data() {
    return {
      styleObject: {
        maxWidth: "400px",
        minWidth: "auto",
        opacity: 1,
        padding: "5px",
        position: "fixed",
        right: "10px",
        top: "10px",
        zIndex: "100 !important" // this doesn't work
        // "z-index": "100 !important" // this works
      }
    };
  }
};
</script>

zIndex is not bound to style

What is expected?

Binding zIndex does not get kebab-cased like maxWidth and minWidth. I expected it to work the same way. Passing z-index works as expected.

What is actually happening?

The zIndex variable is ignored entirely.


I was creating an alert-style box that needs a high z-index to appear "on top" of other elements on the page.

@yyx990803 yyx990803 added the bug label Jan 28, 2019
@yyx990803
Copy link
Member

FYI this is not specific to zIndex. It's caused by camelCase names not converted to kebab-case when the value contains !important.

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

Successfully merging a pull request may close this issue.

2 participants