fix: fixed query result codemirror shake issue upon scroll

This commit is contained in:
Anoop M D 2022-01-26 20:31:49 +05:30
parent 1b78a2c223
commit 6af169ffee
6 changed files with 9 additions and 15 deletions

View File

@ -178,13 +178,6 @@ export default class QueryEditor extends React.Component {
);
}
/**
* Public API for retrieving the DOM client height for this component.
*/
getClientHeight() {
return this._node && this._node.clientHeight;
}
_onKeyUp = (_cm, event) => {
if (AUTO_COMPLETE_AFTER_KEY.test(event.key) && this.editor) {
this.editor.execCommand('autocomplete');

View File

@ -149,7 +149,7 @@ const RequestTabPanel = ({dispatch, actions, collections, activeRequestTabId, re
<div className="drag-request" onMouseDown={handleDragbarMouseDown}>
</div>
<section className="response-pane px-4 flex-grow">
<section className="response-pane flex-grow">
<ResponsePane
rightPaneWidth={rightPaneWidth}
response={item.response}

View File

@ -7,6 +7,10 @@ const StyledWrapper = styled.div`
height: calc(100vh - 230px);
}
textarea.cm-editor {
position: relative;
}
div.overlay{
position: absolute;
top: 0;

View File

@ -37,7 +37,7 @@ const QueryResult = ({data, isLoading, width}) => {
}, [editor.current, cmEditor, data]);
return (
<StyledWrapper className="mt-4 w-full">
<StyledWrapper className="mt-4 px-3 w-full" style={{maxWidth: width}}>
{isLoading && (
<div className="overlay">
<div style={{marginBottom: 15, fontSize: 26}}>
@ -55,10 +55,7 @@ const QueryResult = ({data, isLoading, width}) => {
)}
<div className="h-full">
<textarea
id="operation"
style={{
width: `${width}px`,
}}
id="query-result"
ref={editor}
className="cm-editor"
>

View File

@ -3,7 +3,7 @@ import StyledWrapper from './StyledWrapper';
const ResponseHeaders = ({headers}) => {
return (
<StyledWrapper className="mt-3">
<StyledWrapper className="mt-3 px-3">
<table>
<thead>
<tr>

View File

@ -43,7 +43,7 @@ const ResponsePane = ({rightPaneWidth, response, isLoading}) => {
return (
<StyledWrapper className="flex flex-col h-full">
<div className="flex items-center tabs mt-1" role="tablist">
<div className="flex items-center px-3 tabs mt-1" role="tablist">
<div className={getTabClassname('response')} role="tab" onClick={() => setSelectedTab('response')}>Response</div>
<div className={getTabClassname('headers')} role="tab" onClick={() => setSelectedTab('headers')}>Headers</div>
{!isLoading ? (