Skip to content

Commit

Permalink
fix(devtools): Added type attribute to all button elements (#1581)
Browse files Browse the repository at this point in the history
Adding type attribute tells browser what type of button it is. For most browsers the default type of button is submit. This causes a full page post back in older legacy server rendered frameworks like asp.net webfo
  • Loading branch information
mikelunn committed Jan 5, 2021
1 parent a6c2011 commit 6458c50
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/devtools/devtools.tsx
Expand Up @@ -221,6 +221,7 @@ export function ReactQueryDevtools({
/>
{isResolvedOpen ? (
<Button
type="button"
{...otherCloseButtonProps}
onClick={() => {
setIsOpen(false)
Expand Down Expand Up @@ -255,6 +256,7 @@ export function ReactQueryDevtools({
</ThemeProvider>
{!isResolvedOpen ? (
<button
type="button"
{...otherToggleButtonProps}
aria-label="Open React Query Devtools"
onClick={() => {
Expand Down Expand Up @@ -537,6 +539,7 @@ export const ReactQueryDevtoolsPanel = React.forwardRef(
))}
</Select>
<Button
type="button"
onClick={() => setSortDesc(old => !old)}
style={{
padding: '.3rem .4rem',
Expand Down Expand Up @@ -702,6 +705,7 @@ export const ReactQueryDevtoolsPanel = React.forwardRef(
}}
>
<Button
type="button"
onClick={() => activeQuery.fetch()}
disabled={activeQuery.state.isFetching}
style={{
Expand All @@ -711,6 +715,7 @@ export const ReactQueryDevtoolsPanel = React.forwardRef(
Refetch
</Button>{' '}
<Button
type="button"
onClick={() => queryClient.invalidateQueries(activeQuery)}
style={{
background: theme.warning,
Expand All @@ -720,6 +725,7 @@ export const ReactQueryDevtoolsPanel = React.forwardRef(
Invalidate
</Button>{' '}
<Button
type="button"
onClick={() => queryClient.resetQueries(activeQuery)}
style={{
background: theme.gray,
Expand All @@ -728,6 +734,7 @@ export const ReactQueryDevtoolsPanel = React.forwardRef(
Reset
</Button>{' '}
<Button
type="button"
onClick={() => queryClient.removeQueries(activeQuery)}
style={{
background: theme.danger,
Expand Down

1 comment on commit 6458c50

@vercel
Copy link

@vercel vercel bot commented on 6458c50 Jan 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.