bitovi / bitovi/funcunit

Typing at the start of input inside an Iframe causes cursor to reset to end

Open
#137 0 comments 0 reactions 0 assignees View on GitHub
bug help wanted p2
Dominant language
JavaScript
Stars
571
Forks
370
PR merge metrics
No merged PRs in 30d

Description

When i try to type into a text input that already has text in it while the cursor is positioned at the start it resets it to the end of the input.

I have already located a fix for this, it seems it's using the document var instead of the h.getWindow(el) helper function.

``` javascript
var h = syn.helpers, getSelection = function (el) {
var real, r, start;
if (el.selectionStart !== undefined) {
if (document.activeElement && document.activeElement !== el && el.selectionStart === el.selectionEnd && el.selectionStart === 0) {
return {
```

Should be

``` javascript
var h = syn.helpers, getSelection = function (el) {
var real, r, start;
if (el.selectionStart !== undefined) {
if (h.getWindow(el).document.activeElement && h.getWindow(el).document.activeElement !== el && el.selectionStart === el.selectionEnd && el.selectionStart === 0) {
return {
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.