Skip to content

Commit de81cb4

Browse files
committed
minor fixes
1 parent e769408 commit de81cb4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

2-ui/3-event-details/7-keyboard-events/article.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ function checkPhoneKey(key) {
165165

166166
Now arrows and deletion works well.
167167

168-
Even though we have the key filter, one still can enter anything using a mouse and right-click + Paste. So the filter is not 100% reliable. The more reliable approach would be to track the `input` event -- it triggers after any modification. There we can check the new value and highlight/modify it when it's invalid.
168+
Even though we have the key filter, one still can enter anything using a mouse and right-click + Paste. So the filter is not 100% reliable.
169+
170+
The alternative approach would be to track the `oninput` event -- it triggers *after* any modification. There we can check the new `input.value` and highlight/modify the `<input>` when it's invalid. Or we can use both event handlers together.
169171

170172
## Legacy
171173

0 commit comments

Comments
 (0)