From 9614ab069f786841d09222c76895e2b6062cc94f Mon Sep 17 00:00:00 2001 From: Harshmeet Singh <111004544+maxdiplogit@users.noreply.github.com> Date: Fri, 13 Sep 2024 11:52:22 +0530 Subject: [PATCH] fix: cursor jump to start (#3082) Co-authored-by: maxdiplogit --- .../src/components/RequestPane/QueryUrl/index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js b/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js index bcbf55c919..e80ff8a326 100644 --- a/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js +++ b/packages/bruno-app/src/components/RequestPane/QueryUrl/index.js @@ -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)); }; @@ -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 }) ); }; @@ -64,7 +69,7 @@ const QueryUrl = ({ item, collection, handleRun }) => { > onSave(finalValue)} theme={storedTheme} onChange={(newValue) => onUrlChange(newValue)} onRun={handleRun}