N
N
Nikolino2018-10-14 14:25:34
css
Nikolino, 2018-10-14 14:25:34

Why is text highlighted inside an absolute block?

Recorded GIF https://i.imgur.com/hCvh8l7.gifv

.relative {
    position: relative;
}

.absolute {
    position: absolute;
    top: 300px;
    z-index: 100;
}
.cart {
    text-align: left;
    background-color: white;
    padding: 15px;
    width: 230px;
    height: auto;
    margin-top: 0;
    box-shadow: 0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px 0 rgba(0,0,0,0.20);
}

The block appears/disappears with the v-show directive in Vue, that is, it is added/removed to the DOM. Maybe it somehow affects?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lumore, 2018-10-14
@Nikolino

Wrap the icon in a button, hang an event on the button and remove all styles from it:

button {
background-color: transparent;
border: none;
outline: none;
}

D
daniel_wesson, 2018-10-14
@daniel_wesson

Try disabling selection

-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
-webkit-user-select: none;
user-select: none;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question