Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IS-2849: Submits search on enter #556

Merged
merged 1 commit into from
Nov 29, 2024
Merged

Conversation

andersrognstad
Copy link
Contributor

Endrer til å bruke <form> med onSubmit i stedet onClick på knappen.

@andersrognstad andersrognstad requested a review from a team as a code owner November 29, 2024 09:13
</VStack>
<form
onSubmit={(event) => {
event.preventDefault();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The event.preventDefault(); line is used to prevent the default form submission behavior. In a React application, this is necessary to handle form submissions with custom logic, such as making an API call or updating the state, without causing the page to reload. By preventing the default behavior, you can control what happens when the form is submitted.

Når React 19 kommer med sin utvidelse av form kan dette gjøres smoothere 🎉

Copy link
Contributor

@vetlesolgaard vetlesolgaard left a comment

Choose a reason for hiding this comment

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

Noice!🙌

@andersrognstad andersrognstad merged commit 64c9ec0 into master Nov 29, 2024
3 checks passed
@andersrognstad andersrognstad deleted the IS-2849-search-on-enter branch November 29, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants