rheber / unixorn

:corn: Add a terminal to your webpage
2 stars 1 forks source link

Mobile support is a bit finnicky #39

Open rheber opened 1 year ago

rheber commented 1 year ago

Behavior appears to be that the first character is typed post-cursor and subsequent characters are typed pre-cursor. Moving the input HTML element may be the fix.

giripriyadarshan commented 1 year ago

I am trying to refactor the current implementation of precursor and postcursor completely into 1 input box and play with the cursor position and string separately. React makes dynamic string manipulations easy and shouldn't be an issue. The only concern is caret style and animation as currently, I don't see those options in mdn docs.

reference: https://stackoverflow.com/questions/2897155/get-cursor-position-in-characters-within-a-text-input-field https://stackoverflow.com/questions/512528/set-keyboard-caret-position-in-html-textbox https://developer.mozilla.org/en-US/docs/Web/CSS/caret-color

rheber commented 1 year ago

@giripriyadarshan I've superficially fixed the cursor skipping issue. Currently in the alpha branch I know of three bugs: