New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 1983220: Fix pod terminal second scrollbar when user reduce the window size #9534
Conversation
/cc @sahil143 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jerolimov I opened a bugzilla bug against OCP Management Console to make merging this easier, but see my comments about narrowing down the changes in this PR.
@@ -116,8 +115,11 @@ class Terminal_ extends React.Component { | |||
this.fitAddon.fit(); | |||
// update the pty | |||
this.props.onResize(terminal.rows, terminal.cols); | |||
// The internal xterm textarea was not repositioned when the window was resized. | |||
// This workaround triggers an position update. | |||
this.terminal._core?._syncTextArea?.(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong, but this seems to be the only line needed to fix the bug. I would prefer that the rest of the changes (besides your comments here) be removed from the PR as they don't seem to be relevant to this bug fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TheRealJon your right, and it also make sense to keep this PR small. I dropped all other changes and retested the fix, still works fine. PTAL.
@jerolimov: This pull request references Bugzilla bug 1983220, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
As workaround to fix invalid textarea position when the user resize the browser window
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jerolimov, TheRealJon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@jerolimov: All pull requests linked via external trackers have merged: Bugzilla bug 1983220 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@jerolimov: All pull requests linked via external trackers have merged: Bugzilla bug 1983220 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fixes:
https://issues.redhat.com/browse/ODC-5630
https://bugzilla.redhat.com/show_bug.cgi?id=1983220
Analysis / Root cause:
Xterm uses an invisible textarea to detect keyboard events. This textarea has an absolute position and was permanently moved when the cursor position is changed. But this does not happen when the user resizes the window.
Bad positioned textarea:
Solution Description:
This was NOT solved by updating xterm to 4.13.0. Hoped that because I found this issue: xtermjs/xterm.js#3169
Open a new xterm issue: xtermjs/xterm.js#3390
As workaround call the internal
_syncTextArea
when the window was resized. This method was currently only called when the cursor moved: https://github.com/xtermjs/xterm.js/blob/4.10.0/src/browser/Terminal.ts#L474-L477Screen shots / Gifs for design review:
Broken before in Chrome:
Broken before in Firefox:
Fixed in Chrome:
Fixed in Firefox:
Unit test coverage report:
Unchanged.
Test setup:
find .
orfind /
Browser conformance: