bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-10-30 03:46:07 +03:00
parent a24eb02876
commit cd20c5ab3e
3 changed files with 8 additions and 5 deletions

View File

@ -69,7 +69,7 @@ var getCharOffset = function(elem, x, y, c){
return Math.abs(b.x - x) <= Math.abs(prev.x - x) ? return Math.abs(b.x - x) <= Math.abs(prev.x - x) ?
c + i c + i
: c + i - 1 } } : c + i - 1 } }
c += i c += i - 1
// html node... // html node...
} else { } else {
var res = getCharOffset(e, x, y, c) var res = getCharOffset(e, x, y, c)
@ -1974,6 +1974,7 @@ var Outline = {
elem.selectionStart = elem.value.length elem.selectionStart = elem.value.length
elem.selectionEnd = elem.value.length elem.selectionEnd = elem.value.length
} else { } else {
console.log('---', c)
var m = getMarkdownOffset(elem.value, view.innerText, c) var m = getMarkdownOffset(elem.value, view.innerText, c)
elem.focus() elem.focus()
elem.selectionStart = c + m elem.selectionStart = c + m

View File

@ -60,15 +60,20 @@ HTMLTextAreaElement.prototype.getTextGeometry = function(){
position: 'fixed', position: 'fixed',
display: 'block', display: 'block',
/* DEBUG...
top: '0px',
left: '0px',
/*/
top: '-100%', top: '-100%',
left: '-100%', left: '-100%',
//*/
width: style.width, width: style.width,
height: style.height, height: style.height,
padding: style.padding, padding: style.padding,
boxSizing: style.boxSizing, boxSizing: style.boxSizing,
//whiteSpace: 'pre-wrap', whiteSpace: style.whiteSpace,
outline: 'solid 1px red', outline: 'solid 1px red',

View File

@ -48,9 +48,6 @@ var setup = function(){
- -
- ## Bugs: - ## Bugs:
focused:: true focused:: true
- BUG: focus at times seems to be biased a bit to the right -- the caret is placed to the right from where expected...
-
_this seems to only affect text with leading whitespace only, like this._
- BUG: mobile browsers behave quite chaotically ignoring parts of the styling... - BUG: mobile browsers behave quite chaotically ignoring parts of the styling...
- FF: - FF:
- zooming on edited field - zooming on edited field