mirror of
https://github.com/usebruno/bruno.git
synced 2026-07-08 06:28:33 +00:00
fix: response viewer not updating when focused (read-only editors) (#7218)
* fix: update cursor state handling in CodeEditor for read-only mode * tests: add response pane update test for re-sent requests * refactor: add data-testid attributes for improved testing in RequestBody and RequestBodyMode components; update locators and tests accordingly * test: verify response status code is 200 * test: enhance response pane update tests to verify body editor content after request re-sent * test: add data-testid for method selector and update locators for improved testability
This commit is contained in:
@@ -236,7 +236,8 @@ export default class CodeEditor extends React.Component {
|
||||
// TODO: temporary fix for keeping cursor state when auto save and new line insertion collide PR#7098
|
||||
const nextValue = this.props.value ?? '';
|
||||
const currentValue = this.editor.getValue();
|
||||
if (this.editor.hasFocus?.() && currentValue !== nextValue) {
|
||||
// Skip updating only when focused and editable; read-only editors (e.g. response viewer) must always show new value
|
||||
if (this.editor.hasFocus?.() && currentValue !== nextValue && !this.props.readOnly) {
|
||||
this.cachedValue = currentValue;
|
||||
} else {
|
||||
const cursor = this.editor.getCursor();
|
||||
|
||||
Reference in New Issue
Block a user