Opened 16 years ago
Closed 15 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 follow-up: 2 Changed 16 years ago by
comment:2 Changed 16 years ago by
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 15 years ago by
need: | → Review |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Interface is no longer supported; consider switching to jQuery UI.
Note: See
TracTickets for help on using
tickets.
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;
if (pressedKey == 9) {
this.onblur = function() { this.focus(); this.onblur = null; };
this.focus(); }
This works in Firefox 2 and in IE7. Dunno about other browsers.