liveBook · Manning

Default action

A default action is the browser-defined behavior normally performed in response to an event when that behavior is not canceled.

How 2 Manning books explain it

React Quickly, Second Edition

A default action is the browser behavior normally performed in response to an event when that behavior is not canceled.

How it is used
Handles browser behaviors that conflict with React interfaces, especially form submission and navigation.
How deep it goes
Explains browser defaults, React’s preventDefault() method, form-level handling, Enter-key submission, and cancellable-event limits.
Examples
Uses an admin login form, a button inside a form, link navigation, keyboard input, scrolling, and drag events.
What you can do after
Apply via React event handlers by moving submission logic to onSubmit and calling preventDefault() when cancellation is required.

Read how React Quickly, Second Edition explains default action →

Pro ASP.NET Core 7, Tenth Edition

Default event behavior is the browser-defined action that normally occurs when an event is triggered.

How it is used
Prevents form submission when a Blazor button click is meant to update a counter.
How deep it goes
Explains the form-submission problem and the preventDefault parameter through component code, without detailing browser event internals.
Examples
Uses Increment Counter buttons inside a form to show an unwanted submission and its prevention.
What you can do after
Operate/configure it with @onclick:preventDefault to stop a button click from submitting its enclosing form.

Read how Pro ASP.NET Core 7, Tenth Edition explains default action →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.