Skip to content

Commit

Permalink
fix: cursor jump to start (usebruno#3082)
Browse files Browse the repository at this point in the history
Co-authored-by: maxdiplogit <[email protected]>
  • Loading branch information
maxdiplogit and maxdiplogit authored Sep 13, 2024
1 parent 81d8c30 commit 9614ab0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/bruno-app/src/components/RequestPane/QueryUrl/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ const QueryUrl = ({ item, collection, handleRun }) => {
setMethodSelectorWidth(el.offsetWidth);
}, [method]);

const onSave = () => {
const onSave = (finalValue) => {
dispatch(requestUrlChanged({
itemUid: item.uid,
collectionUid: collection.uid,
url: finalValue && typeof finalValue === 'string' ? finalValue.trim() : value
}));
dispatch(saveRequest(item.uid, collection.uid));
};

Expand All @@ -34,7 +39,7 @@ const QueryUrl = ({ item, collection, handleRun }) => {
requestUrlChanged({
itemUid: item.uid,
collectionUid: collection.uid,
url: value && typeof value === 'string' ? value.trim() : value
url: (value && typeof value === 'string') && value
})
);
};
Expand Down Expand Up @@ -64,7 +69,7 @@ const QueryUrl = ({ item, collection, handleRun }) => {
>
<SingleLineEditor
value={url}
onSave={onSave}
onSave={(finalValue) => onSave(finalValue)}
theme={storedTheme}
onChange={(newValue) => onUrlChange(newValue)}
onRun={handleRun}
Expand Down

0 comments on commit 9614ab0

Please sign in to comment.