Bug Tracker

Opened 13 years ago

Closed 12 years ago

#1065 closed bug (wontfix)

Tab in interface brings to top of textarea

Reported by: kanno41 Owned by: stefan
Priority: minor Milestone: 1.1.3
Component: interface Version: 1.1.2
Keywords: tab Cc:
Blocked by: Blocking:

Description

While using the Tabbing feature of the interface plugin when there is a scrollbar, it tabs over but scrolls to the top of the textarea at the same time.

Change History (3)

comment:1 Changed 13 years ago by nev3rm0re

I found a code somewhere, that fixes this issue, can't find a bookmark at the moment.

I made following changes to ittabs.js

var sct = this.scrollTop; var l = this.value.length;

pressedKey = e.charCode
e.keyCode -1;

if (pressedKey == 9) {

if (window.event) {

window.event.cancelBubble = true; window.event.returnValue = false;

} else {

e.preventDefault(); e.stopPropagation();

} if (this.createTextRange) {

var range = document.selection.createRange(); range.text=" "; range.moveStart("character", -1);

this.onblur = function() { this.focus(); this.onblur = null; };

} else if (this.setSelectionRange) {

start = this.selectionStart; end = this.selectionEnd; this.value = this.value.substring(0, start) + " " + this.value.substr(end); this.setSelectionRange(start + 1, start + 1); this.scrollTop = sct;

this.focus(); }

This works in Firefox 2 and in IE7. Dunno about other browsers.

comment:2 in reply to:  1 Changed 13 years ago by nev3rm0re

Sorry about ugly Javascript, here's the syntax highlighted version

doTab : function(e) {
    var sct = this.scrollTop;
    var l = this.value.length;

    pressedKey = e.charCode || e.keyCode || -1;
    if (pressedKey == 9) {
        if (window.event) {
            window.event.cancelBubble = true;
            window.event.returnValue = false;
        } else {
        e.preventDefault();
            e.stopPropagation();
        }
        if (this.createTextRange) {
            var range = document.selection.createRange();
            range.text="        ";
            range.moveStart("character", -1);
//          this.onblur = function() { this.focus(); this.onblur = null; };
        } else if (this.setSelectionRange) {
            start = this.selectionStart;
            end = this.selectionEnd;
            this.value = this.value.substring(0, start) + "     " + this.value.substr(end);
            this.setSelectionRange(start + 1, start + 1);
            this.scrollTop = sct;
//          this.focus();
        }
        return false;
    }
}

comment:3 Changed 12 years ago by scott.gonzal

need: Review
Resolution: wontfix
Status: newclosed

Interface is no longer supported; consider switching to jQuery UI.

Note: See TracTickets for help on using tickets.