fix: cursor jump to start (#3082)

Co-authored-by: maxdiplogit <maxdiplo@Harshmeets-MacBook-Air.local>
This commit is contained in:
Harshmeet Singh 2024-09-13 11:52:22 +05:30 committed by GitHub
parent 81d8c30d84
commit 9614ab069f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,7 +25,12 @@ const QueryUrl = ({ item, collection, handleRun }) => {
setMethodSelectorWidth(el.offsetWidth); setMethodSelectorWidth(el.offsetWidth);
}, [method]); }, [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)); dispatch(saveRequest(item.uid, collection.uid));
}; };
@ -34,7 +39,7 @@ const QueryUrl = ({ item, collection, handleRun }) => {
requestUrlChanged({ requestUrlChanged({
itemUid: item.uid, itemUid: item.uid,
collectionUid: collection.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 }) => {
> >
<SingleLineEditor <SingleLineEditor
value={url} value={url}
onSave={onSave} onSave={(finalValue) => onSave(finalValue)}
theme={storedTheme} theme={storedTheme}
onChange={(newValue) => onUrlChange(newValue)} onChange={(newValue) => onUrlChange(newValue)}
onRun={handleRun} onRun={handleRun}