bitovi/funcunit

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

Open

#137 geöffnet am 10. Feb. 2016

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (395 Forks)batch import
bughelp wantedp2

Repository-Metriken

Stars
 (575 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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.

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

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