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 target wrapper div of select element in a module

See original GitHub issue

I’m writing a Tailwind-based module for formio.js, and I’m having trouble targeting the wrapper div for a <select> element. I’ve attached a screenshot showing the markup output by formio.js without a module used; the element I’m attempting to modify is the div with a formio-choices class name. I’d like to figure out how to alter the rendering of this element so I can add/remove class names.

Any guidance on how to target that element from my module would be extremely appreciated! CleanShot 2020-02-20 at 16 27 16@2x

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
randallknutsoncommented, Feb 21, 2020

If you go to next.form.io, add a Select component and go to the “Data” tab you will see Choices options as a configuration option. That’s the main way to set these right now. To do it programmatically would involve extending the Select component and overriding the defaults. We would be open to making it more customizable though.

0reactions
tnorthcuttcommented, Feb 24, 2020

Thanks, @randallknutson. Turns out my syntax was just off; for the sake of posterity here’s an example of what works:

{
  "classNames": {
    "containerOuter": "classnames-go-here space-separated",
    "containerInner": "classnames-go-here space-separated"
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Select elements filtering them if they belong to nested ...
I want to select elements that have class target. This is what I am using to do so, $(.container).find('.target); But, the problem is...
Read more >
target - CSS: Cascading Style Sheets - MDN Web Docs
The :target CSS pseudo-class represents a unique element (the target element) with an id matching the URL's fragment.
Read more >
Lesson 1: Understanding ID and Class in CSS
Activities · Open your portfolio's index. · Review the content of your page. · Notice how many <div> elements there are. · The...
Read more >
Select Page Elements | Basic Guides - TestCafe
Pass a CSS selector string or a client-side function to the Selector constructor to create a selector. import { Selector } from 'testcafe';...
Read more >
CSS - Its All About Understanding Selectors - mojoPortal
div h2 {} - Select all h2 elements that are within a div. ... Html Content feature on a page it will have...
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