E
E
Eduard Valeev2020-12-17 01:05:00
css
Eduard Valeev, 2020-12-17 01:05:00

How to make position: sticky work with vuetify?

I set the block "stickiness":

.sticky {
        position: -webkit-sticky;
        position: sticky;
        top: 2em;
    }

After it didn't work, it turned out that the property position: stickydoesn't work if either parent has an overflow property that is set to hidden or scroll.

It turned out that these values ​​are present in the body element in my project (and they can be turned off with the mouse):
5fda83fd6c914001363108.png

However, as it turns out, these css properties for the body tag are set by the vuetify engine (highlighted in blue) and I don’t understand at all how I can do it on a single page (but I don’t want to completely for the entire project, suddenly it’s necessary somewhere) to kill these properties, at least with the help of !important, but it’s better to cancel them entirely or maybe somehow remove them with a script.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eduard Valeev, 2020-12-17
@Adward

I asked a crutch, but this is not a solution:

mounted() {      
        document.getElementsByTagName('body')[0].style.overflowX = "visible"
    },

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question