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.

Need custom Css class option for Dropdown/Datepicker similar to Tooltip

See original GitHub issue

I need to assign a custom Css class to the dropdown of Dropdown and Datepicker. Need similar api to existing tooltipClass option for Tooltip. We are using container="body" for both Dropdown and Datepicker and sometimes we need to assign custom theme coloration to the Dropdown and Datepicker via a Css class.

I also noticed that Modal and Popover already have a similar Css class option.

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
dasco144commented, Apr 22, 2020

I have a similar issue but I need to override the z-index of the div.dropdown element created on the body to fix an issue where the dropdown is appearing behind the popover that has the drop down toggle.

image

Is there perhaps another way to target this div.dropdown element on the body to add this z-index?

1reaction
gpolychroniscommented, Mar 18, 2020

@hughanderson4 You can add a custom class on Dropdown. No change is needed on ng-bootstrap side. i.e:

  <div ngbDropdownMenu aria-labelledby="dropdownBasic1" class="custom-class">
    <button ngbDropdownItem>Action - 1</button>
    <button ngbDropdownItem>Another Action</button>
    <button ngbDropdownItem>Something else is here</button>
  </div>

and css:

  .custom-class {
      background-color: pink;
  }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding custom class to tooltip - Stack Overflow
I have tried many different solutions but i allways end up adding a class to the element that triggers the tooltip. This is...
Read more >
Options — bootstrap-datepicker documentation - Read the Docs
All options that take a “Date” can handle a Date object; a String formatted ... A String representing additional CSS classes to apply...
Read more >
Jquery datepicker along with custom tooltips for textbox. - MSDN
Hello,. I have a page that enables user to input some data in various textboxes and dropdownlists. I've used the jquery datepicker for...
Read more >
jQuery UI Tooltip tooltipClass Option - GeeksforGeeks
The jQuery UI Tooltip tooltipClass option is used to add various tooltip styles using CSS properties on the class. Syntax:.
Read more >
Tooltip - jQuery UI
When you hover the element with your mouse, the title attribute is displayed in a little box next to the element, just like...
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