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.

How to apply css to dropdown list when the prop appendToBody is true

See original GitHub issue

How can I apply some css to change background of the dropdown list, when I’m using the prop appendToBody, the div is at the end of the body, there is some way to add a class or replace the ID?

I’m trying to applying some dark style…

image

<v-select class="select-x" taggable v-model="value" append-to-body :options="options"></v-select>

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
sagalbotcommented, Dec 23, 2020

@SchmidtDawid I didn’t fully understand the scope of the issue.

@alantea thanks for posting your solution! It’s almost perfect, but it leaves you in charge of implementing the positioning yourself. Let me know what you think of the API in #1341. @EricRabil & @uturnr, would this API work for you as well?

<v-select @dropdown:appending="({ el }) => el.classList.add('style-chooser')" />
5reactions
sagalbotcommented, Sep 1, 2020

The .vs__dropdown-menu class is still applied, you can target that for your css 👍🏻

Read more comments on GitHub >

github_iconTop Results From Across the Web

appendToBody - Vue Select
When appendToBody is true, this function is responsible for positioning the drop down list. If a function is returned from calculatePosition , it...
Read more >
angular - How to tell a dropdown to always expand to the top
I noticed the dropdown sometimes opens to the top, which I like in this particular case and I'd like to force it to...
Read more >
How to style a dropdown using CSS? - GeeksforGeeks
In this article, we will know how to style the dropdown list using CSS & will understand its implementation through the examples.
Read more >
Vue2 date range picker - v0.6.8
Set true or 'single' for a single calendar with no ranges, single dates only. ... is true, this function is responsible for positioning...
Read more >
CSS Dropdowns - W3Schools
dropdown -content class holds the actual dropdown content. It is hidden by default, and will be displayed on hover (see below). Note the...
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