Skip to content

Commit 259fc00

Browse files
Update article.md
1 parent d0167c6 commit 259fc00

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

2-ui/4-forms-controls/2-focus-blur/article.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@
8787

8888
این روی تمام مرورگرها به جز Firefox کار می‌کند ([bug](https://bugzilla.mozilla.org/show_bug.cgi?id=53579)).
8989

90-
If we enter something into the input and then try to use `key:Tab` or click away from the `<input>`, then `onblur` returns the focus back.
90+
اگر چیزی را در input وارد کنیم و سپس سعی کنیم از `key:Tab` استفاده کنیم یا روی input کلیک کنیم، `onblur` فوکوس را برمی‌گرداند.
9191

92-
Please note that we can't "prevent losing focus" by calling `event.preventDefault()` in `onblur`, because `onblur` works *after* the element lost the focus.
92+
لطفا توجه داشته باشید که ما نمی‌توانیم با فراخوانی `event.preventDefault()` از "از دست دادن focus" در `onblur` جلوگیری کنیم، چون `onblur` *پس از* اینکه عنصر focus را از دست می‌دهد کار می‌کند.
9393

94-
In practice though, one should think well, before implementing something like this, because we generally *should show errors* to the user, but *should not prevent their progress* in filling our form. They may want to fill other fields first.
94+
اگرچه در عمل، قبل از اینکه چیزی مثل این را پیاده‌سازی کنیم،‌باید خوب فکر کنیم، چون به طور کلی *باید به کاربر error نمایش دهیم* اما *نباید مانع پیشرفت آن‌ها* در پر کردن form خودمان شویم. ممکن است آن‌ها بخواهند ابتدا fieldهای دیگر را پر کنند.
9595

9696
```warn header="JavaScript-initiated focus loss"
97-
A focus loss can occur for many reasons.
97+
ممکن است به دلایل مختلفی رخ دهد focus از دست رفتن
9898
99-
One of them is when the visitor clicks somewhere else. But also JavaScript itself may cause it, for instance:
99+
:هم می‌تواند باعث آن شود. برای مثال javascript می‌کند اما خود click یکی از آن‌ها وقتی است که بازدیدکننده روی جای دیگری
100100
101101
- An `alert` moves focus to itself, so it causes the focus loss at the element (`blur` event), and when the `alert` is dismissed, the focus comes back (`focus` event).
102102
- If an element is removed from DOM, then it also causes the focus loss. If it is reinserted later, then the focus doesn't return.

0 commit comments

Comments
 (0)