You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 2-ui/4-forms-controls/3-events-change-input/article.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,9 +31,9 @@
31
31
32
32
هر بار پس از آن که یک مقدار توسط کاربر تغییر میکند، `input` event فعال میشود.
33
33
34
-
Unlike keyboard events, it triggers on any value change, even those that does not involve keyboard actions: pasting with a mouse or using speech recognition to dictate the text.
34
+
برعکس keyboard inputها، آن با هر تغییر مقداری فعال میشود، حتی آنهایی که شامل keyboard actions نمیشوند: paste کردن با یک موش یا استفاده از تشخیص گفتار برای دیکته کردن متن.
If we want to handle every modification of an `<input>`then this event is the best choice.
47
+
اگر بخواهیم تمام تغییرات یک `<input>`را هندل کنیم، آنگاه این event بهترین انتخاب است.
48
48
49
-
On the other hand, `input` event doesn't trigger on keyboard input and other actions that do not involve value change, e.g. pressing arrow keys `key:⇦``key:⇨`while in the input.
49
+
از طرفی دیگر، `input` event با keyboard input و فعالیتهای دیگری که شامل تغییر value نمیشوند فعال نمیشود، مثل فشار دادن کلیدهای جهتدار `key:⇦``key:⇨`زمانی که داخل input هستیم.
50
50
51
-
```smart header="Can't prevent anything in `oninput`"
52
-
The `input` event occurs after the value is modified.
51
+
```smart header="جلوگیری کرد. `oninput` نمیتوان از چیزی در"
53
52
54
-
So we can't use `event.preventDefault()` there -- it's just too late, there would be no effect.
53
+
بعد از اینکه value تغییر میکند، `input` event فعال میشود.
54
+
55
+
56
+
پس آن جا نمیتوانیم از `event.preventDefault()` استفاده کنیم -- بسیار دیر است و تاثیری نخواهد داشت.
55
57
```
56
58
57
59
## Events: cut, copy, paste
58
60
59
-
These events occur on cutting/copying/pasting a value.
61
+
این eventها زمان cut کردن/copy کردن/paste کردن یک مقدار اتفاق میافتند.
60
62
61
-
They belong to [ClipboardEvent](https://www.w3.org/TR/clipboard-apis/#clipboard-event-interfaces) class and provide access to the data that is cut/copied/pasted.
63
+
انها به [ClipboardEvent](https://www.w3.org/TR/clipboard-apis/#clipboard-event-interfaces) class تعلق دارند و دسترسی به دادهای را که cut/copy/paste شده را فراهم میکنند.
62
64
63
-
We also can use `event.preventDefault()` to abort the action, then nothing gets copied/pasted.
65
+
همچنین میتوانیم برای لغو یک action از `event.preventDefault()` استفاده کنیم، آنگاه هیچ چیز copy/paste نمیشود.
64
66
65
67
For instance, the code below prevents all `cut/copy/paste` events and shows the text we're trying to cut/copy/paste:
0 commit comments