track cursor position in a multiline input
I manage to track it using [the action below ] ( https://toddle.dev/projects/moccasin_palpatine_chief_rook/branches/start/components/test11?rightpanel=style&selection=nodes.paPL1Pk8ud9UbwhcgJyzq&canvas-width=800&canvas-height=800&leftpanel=Files ) but now I am not sure how can I access the cursorPosition and user that to add a text after that function trackCursorPosition (args , ctx ) { const input = ctx .root .querySelector ( " #abc " ) ; / / Use ctx .root instead of document const cursorPosition = input .selectionStart ; console .log (cursorPosition ) ; / / This will log to the browser console return cursorPosition ; / / Return the position for use in your app } You don 't even need custom stuff for that . Sorry , was not at my laptop . You can do it like that if you want to track the position : https://toddle.dev/projects/indigo__icket_systri__arrick_smart_hyena/branches/start/components/HomePage?canvas-width=800&canvas-height=800&mode=design&rightpanel=style It is here , in the event : https://toddle.dev/projects/indigo__icket_systri__arrick_smart_hyena/branches/start/components/HomePage?mode=design&canvas-height=800&canvas-width=800&selection=nodes.NlYLVbd4V7hdoj3SYMYVM.events.selectionchange.actions.0.data&rightpanel=events Click the link , it will lead you right to it