3 ms·
Found a bug, if you start an input form with multiple spaces it doesn't work as expected, it seems like only visible characters add to the calculated offset.
by mattigames 4y ago
Found a bug, if you start an input form with multiple spaces it doesn't work as expected, it seems like only visible characters add to the calculated offset.
- manbash 4y agoI would like to add about the text input: I expected that if I edit my text input e.g. put the caret (text cursor) in the beginning of the text, then the focus will change. This is not the case, even when typing.
- jj811208 4y agoI like the idea of watching the text cursor! Maybe it could be an option wait until the project is a little more stable (more testing). I will do some refactoring and look into looking at this
- tralarpa 4y agoIt also ignores the cursor position in the entered text (i.e., it will always look at the last character). That's because the code creates a fake input element with the same font and input as the visible element and uses its size to determine the position to look at. Strange that it doesn't work for input with leading spaces, though.
- samwillis 4y agoIt's probably either trimming the string, or the dom is collapsing the spaces to a single space (as is standard). It's possible to fetch the cursor position in the input.
- jj811208 4y agoI will look into this, thanks for letting me know