Skip to content

Commit

Permalink
fix: re-initialize the parameter editor state when switching between …
Browse files Browse the repository at this point in the history
…requests (#7005)

* re-initialize the one-line editor when the request changes

* fix lint?

* cleanup lint
  • Loading branch information
gatzjames committed Jan 19, 2024
1 parent fac18ee commit df0a791
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/insomnia/src/ui/components/panes/request-pane.tsx
Expand Up @@ -209,7 +209,7 @@ export const RequestPane: FC<Props> = ({
<OneLineEditor
key={activeRequest._id}
id={'key-value-editor__name' + pathParameter.name}
placeholder={'Parameter value'}
placeholder="Parameter value"
defaultValue={pathParameter.value || ''}
onChange={name => {
onPathParameterChange(pathParameters.map(p => p.name === pathParameter.name ? { ...p, value: name } : p));
Expand Down
Expand Up @@ -321,6 +321,7 @@ export const WebSocketRequestPane: FC<Props> = ({ environment }) => {
<OneLineEditor
readOnly={disabled}
id={'key-value-editor__name' + pathParameter.name}
key={activeRequest._id}
placeholder={'Parameter value'}
defaultValue={pathParameter.value || ''}
onChange={name => {
Expand Down

0 comments on commit df0a791

Please sign in to comment.