Skip to content

Commit

Permalink
fix jumping issue #565
Browse files Browse the repository at this point in the history
When you scrolled down the terminal the value of top on textarea was negative
so it moved outside of visible area and when you focus on textarea
it was jumping, using Math.max(value, 0) solved the issue
  • Loading branch information
jcubic committed Apr 18, 2020
1 parent 56ed710 commit a58908f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.15.4
### Bugfix
* fix jumping when you scrolled down the div terminal [#565](https://github.com/jcubic/jquery.terminal/issues/565)

## 2.15.3
### Bugfix
* fix broken formatting in prism.js when processing brackets
Expand Down
6 changes: 3 additions & 3 deletions js/jquery.terminal-2.15.3.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Thu, 16 Apr 2020 19:57:39 +0000
* Date: Sat, 18 Apr 2020 05:50:04 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -4356,7 +4356,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: '2.15.3',
date: 'Thu, 16 Apr 2020 19:57:39 +0000',
date: 'Sat, 18 Apr 2020 05:50:04 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -9958,7 +9958,7 @@
var self_offset = self.offset();
textarea.css({
left: self_offset.left - offset.left,
top: self_offset.top - offset.top
top: Math.max(self_offset.top - offset.top, 0)
}).focus();
self.stopTime('focus');
self.oneTime(10, 'focus', function() {
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal-2.15.3.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -9958,7 +9958,7 @@
var self_offset = self.offset();
textarea.css({
left: self_offset.left - offset.left,
top: self_offset.top - offset.top
top: Math.max(self_offset.top - offset.top, 0)
}).focus();
self.stopTime('focus');
self.oneTime(10, 'focus', function() {
Expand Down
6 changes: 3 additions & 3 deletions js/jquery.terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
*
* broken image by Sophia Bai from the Noun Project (CC-BY)
*
* Date: Thu, 16 Apr 2020 19:57:39 +0000
* Date: Sat, 18 Apr 2020 05:50:04 +0000
*/
/* global define, Map */
/* eslint-disable */
Expand Down Expand Up @@ -4356,7 +4356,7 @@
// -------------------------------------------------------------------------
$.terminal = {
version: '2.15.3',
date: 'Thu, 16 Apr 2020 19:57:39 +0000',
date: 'Sat, 18 Apr 2020 05:50:04 +0000',
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
color_names: [
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
Expand Down Expand Up @@ -9958,7 +9958,7 @@
var self_offset = self.offset();
textarea.css({
left: self_offset.left - offset.left,
top: self_offset.top - offset.top
top: Math.max(self_offset.top - offset.top, 0)
}).focus();
self.stopTime('focus');
self.oneTime(10, 'focus', function() {
Expand Down
4 changes: 2 additions & 2 deletions js/jquery.terminal.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/jquery.terminal.min.js.map

Large diffs are not rendered by default.

0 comments on commit a58908f

Please sign in to comment.