Closed tylly closed 2 years ago
I'm unsure of what you're trying to do with your drop down, and I think some extra context would help shot in the dark suggestion - have you tried using datalists from vanilla bootstrap https://getbootstrap.com/docs/5.0/forms/form-control/#datalists ?
I want this dropdown arrow button inside of the tags input field
I kiiiiiind of solved it with this
<div id="tagField">
<Form.Control
placeholder="Tags"
name="tags"
id={project._id}
value={tags}
className="mt-2"
style={{ textAlign: "center" }}
></Form.Control>
<Dropdown>
<DropdownButton
style={{ marginTop: "8px" }}
onSelect={handleSelect}
>
<Tags />
</DropdownButton>
</Dropdown>
</div>
and then i adjusted the displaying styling of the parent div with css. so now it looks like this
but now value (or placeholder) of the tags input isnt aligned with the others
that's fixable with css stuff - like setting the width to a screen % etc.
Check out the ToyForm from the pets app, we used a dropdown menu there for the condition
field:
ToyForm.js
@timmshinbone Thank you !
What stack are you using?
(ex: MERN(mongoose + react), DR(django + react), PEN, etc.)
MERN
What's the problem you're trying to solve?
I would like to nest a bootstrap Dropdown inside of a bootstrap Form.Control
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
AS the code is set up, there is no error because the dropdown is above the form control. when i try to nest it by making form control a non-self closing tag and putting the dropdown in between, i get this
What is your best guess as to the source of the problem?
boostrap limitations
What things have you already tried to solve the problem?
tried to nest the dropdown in the form control like described above, tried to nest the dropdown in a standard html input
Paste a link to your repository here https://github.com/tylly/project-4-react