I am struggling to figure out how to fit a text area and submit button inside an Accordion item.
My attempts lead to error messages that ask me…
"Did you forget to wrap multiple children
in an array?"
When I try to apply what I can find about children in the documentation in ways that make sense to me, it takes me straight back to these kind of error messages: “SyntaxError: positional argument follows keyword argument.”
Can someone please explain how to apply the concept of children in an Accordion item, preferably with a text area and submit button? One working example would help me greatly.
Below, I pasted my current code which produces the “positional argument follows keyword argument” error message in reference to the lines: "item_id=“acc_textarea”,)]
), " as I tried to mark below.
I feel like I am missing something obvious. My eyes tell me I have placed the children inside a list as required.
But my eyes are a little tired at this point.
Thank you for reviewing my question.
external_stylesheets=[dbc.themes.SUPERHERO]
app = dash.Dash(external_stylesheets=external_stylesheets)
app.layout = html.Div(
[ html.Br(),
html.H4("Welcome to the Ingredible's Nutrition Assistant"),
html.Br(),
dbc.Accordion(
[
dbc.AccordionItem(
html.Div(children = [
dcc.Textarea(id='recipe-textarea', value='', style={'width': '80%', 'height': 400, 'spellCheck': True}, placeholder="Please Note: All information in brackets or parantheses will be deleted.",
html.Button('Submit Recipe', id='recipe-textarea-submit-button', n_clicks=0),
title="Step 1: Please paste your recipe content here.",
**item_id="acc_textarea",)]**
** ),**
dbc.AccordionItem(
"This is the content of the second section",
title="Item 2",
item_id="acc_datatable",
),