Skip to content

Commit

Permalink
fix(Authenticator): clicking on current tab switches tabs (#5912)
Browse files Browse the repository at this point in the history
* fix clicking on current tab switching tabs

* use newRoute for route changing

* Create brown-pumpkins-knock.md
  • Loading branch information
hbuchel authored Oct 17, 2024
1 parent d52a6f3 commit 6fea94b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/brown-pumpkins-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aws-amplify/ui-react": patch
---

fix(React/Authenticator): clicking on currently active tab no longer switches to the wrong tab
2 changes: 1 addition & 1 deletion docs/next-env.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ export const SignInSignUpTabs = ({
<Tabs.Container
value={route}
isLazy
onValueChange={() => (route === 'signIn' ? toSignUp() : toSignIn())}
onValueChange={(newRoute) => {
if (newRoute !== route) {
newRoute === 'signIn' ? toSignIn() : toSignUp();
}
}}
>
<Tabs.List spacing="equal" indicatorPosition="top">
<Tabs.Item value="signIn">{getSignInTabText()}</Tabs.Item>
Expand Down

0 comments on commit 6fea94b

Please sign in to comment.