Skip to content

fix: summary improvements and grammar - Events change/input #3357

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ importance: 5

# Deposit calculator

Create an interface that allows to enter a sum of bank deposit and percentage, then calculates how much it will be after given periods of time.
Create an interface that allows user to enter their bank deposit and interest percentage, then calculates how much the balance will be after a given period of time.

Here's the demo:

Expand All @@ -14,8 +14,8 @@ Any input change should be processed immediately.

The formula is:
```js
// initial: the initial money sum
// interest: e.g. 0.05 means 5% per year
// initial: the initial money(deposit)
// interest: e.g. 5% per year means 0.05
// years: how many years to wait
let result = Math.round(initial * (1 + interest) ** years);
```
6 changes: 3 additions & 3 deletions 2-ui/4-forms-controls/3-events-change-input/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ It's possible to copy/paste not just text, but everything. For instance, we can

That's because `clipboardData` implements `DataTransfer` interface, commonly used for drag'n'drop and copy/pasting. It's a bit beyond our scope now, but you can find its methods in the [DataTransfer specification](https://html.spec.whatwg.org/multipage/dnd.html#the-datatransfer-interface).

Also, there's an additional asynchronous API of accessing the clipboard: `navigator.clipboard`. More about it in the specification [Clipboard API and events](https://www.w3.org/TR/clipboard-apis/), [not supported by Firefox](https://caniuse.com/async-clipboard).
Also, there's an additional asynchronous API for accessing the clipboard: `navigator.clipboard`. More about it in the specification [Clipboard API and events](https://www.w3.org/TR/clipboard-apis/), [not supported by Firefox](https://caniuse.com/async-clipboard).

### Safety restrictions

Expand All @@ -109,6 +109,6 @@ Data change events:

| Event | Description | Specials |
|---------|----------|-------------|
| `change`| A value was changed. | For text inputs triggers on focus loss. |
| `input` | For text inputs on every change. | Triggers immediately unlike `change`. |
| `change`| The value of the element has finished changing. | For text inputs - triggered only after focus loss. For other inputs - triggered immediately when the selection changes. |
| `input` | The value of the element has changed. | Triggered immediately for all inputs, unlike `change`. |
| `cut/copy/paste` | Cut/copy/paste actions. | The action can be prevented. The `event.clipboardData` property gives access to the clipboard. All browsers except Firefox also support `navigator.clipboard`. |