I’ve been trying to use selectionStart inside the dcc.Input() but I’m not sure how to make it work according to the documentation. This is my code so far:
app.layout = html.Div([
html.Div([
dcc.Input(
id='my_txt_input',
type='text',
debounce=True,
#selectionStart=" ",
),
]),
html.Div(id='div_output'),
html.P(['Selection Start:']),
html.Div(id='div_slct_Start'),
])
@app.callback(
[Output(component_id='div_output', component_property='children'),
Output(component_id='div_slct_Start', component_property='children')
],
[Input(component_id='my_txt_input', component_property='value'),
Input(component_id="my_txt_input", component_property='selectionStart')
]
)
def update_input(txt_inserted, slct_start)
return(txt_inserted, slct_start)
Nothing seems to happen, and I always get a None type. This example demonstrates how selectionStart is read.
Can someone please explain how selectionStart works inside dcc.Input()
Thank you,
In fact, my goal is to put some Markdown buttons on my Inputs and Textareas not unlike what is on this very widget.