-
Notifications
You must be signed in to change notification settings - Fork 83
Focusing: focus/blur #160
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
Focusing: focus/blur #160
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tolong diperbaiki beberapa bahasanya gan. terimakasih telah membantu projek open source ini berkembang 👋
3. Focus on the textarea. | ||
4. Show buttons OK/CANCEL under the cell, handle clicks on them. | ||
1. Saat diklik -- ganti `innerHTML` dari sel oleh `<textarea>`dengan ukuran yang sama dan tanpa border. Bisa menggunakan JavaScript atau CSS untuk mengatur ukuran yang sesuai. | ||
2. Set `textarea.value` ke `td.innerHTML`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set belum diterjemahin, bisa diubah jadi atur atau ubah
2. Set `textarea.value` to `td.innerHTML`. | ||
3. Focus on the textarea. | ||
4. Show buttons OK/CANCEL under the cell, handle clicks on them. | ||
1. Saat diklik -- ganti `innerHTML` dari sel oleh `<textarea>`dengan ukuran yang sama dan tanpa border. Bisa menggunakan JavaScript atau CSS untuk mengatur ukuran yang sesuai. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sepertinya lebih baik kata "oleh" nya dihilangkan, agar mempermudah pembacaan dan jangan lupa spasi setelah <textarea>
- Only one cell may be editable at a moment. While a `<td>` is in "edit mode", clicks on other cells are ignored. | ||
- The table may have many cells. Use event delegation. | ||
- Saat diklik -- sel akan menjadi "editable" (textarea muncul dalam), kita bisa mengubah HTML. Tidak boleh mengubah ukurannya, semua geometri harus tetap sama.. | ||
- Tombol OK and CANCEL muncul di bawah sel untuk finish/cancel editing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kata finish/cancel bisa diterjemahkan lagi , contoh kalimat: "tombol ok dan cancel muncul dibawah sel untuk menyelesaikan atau membatalkan proses sunting/perubahan."
- The table may have many cells. Use event delegation. | ||
- Saat diklik -- sel akan menjadi "editable" (textarea muncul dalam), kita bisa mengubah HTML. Tidak boleh mengubah ukurannya, semua geometri harus tetap sama.. | ||
- Tombol OK and CANCEL muncul di bawah sel untuk finish/cancel editing. | ||
- Hanya satu sel yang dapat diedit setiap saat. Sementara `<td>` dalam "edit mode", klik pada sel lain akan diabaikan. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saran tambahkan imbuhan "nya "agar menekankan di satu moment . "Hanya satu sel yang dapat diedit setiap saatnya"
@@ -1,6 +1,6 @@ | |||
|
|||
We can use `mouse.onclick` to handle the click and make the mouse "moveable" with `position:fixed`, then `mouse.onkeydown` to handle arrow keys. | |||
Kita bisa gunakan `mouse.onclick` untuk menghandle klik dan membuat mouse "moveable/bergerak" dengan `position:fixed`, kemudian `mouse.onkeydown` untuk handle tombol panah. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
menghandle bisa diubah menjadi menangani/mengatur
|
||
The only pitfall is that `keydown` only triggers on elements with focus. So we need to add `tabindex` to the element. As we're forbidden to change HTML, we can use `mouse.tabIndex` property for that. | ||
Satu-satunya jebakan ialah `keydown` hanya trigger pada elemen dengan fokus. Jadi kita perlu untuk menambahkan `tabindex` pada elemen. Karena kita dilarang mengubah HTML, kita bisa gunakan `mouse.tabIndex` properti untuk itu. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trigger bisa diubah menjadi memicu, contoh: keydown
hanya memicu pada elemen yang memiliki fokus. dan properti bisa diletakkan didepan agar sesuai dengan kaidah bahasa , contoh : kita bisa gunakan propertimouse.tabIndex
untuk itu.
|
||
[demo src="solution"] | ||
|
||
P.S. Don't put event handlers anywhere except the `#mouse` element. | ||
P.P.S. Don't modify HTML/CSS, the approach should be generic and work with any element. | ||
P.S. Jangan letakkan event handler dimanapun kecuali elemen `#mouse`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tambahkan kata "pada" agar lebih menjelaskan dimana elemen mouse. contoh: "Jangan letakkan event handler dimanapun kecuali pada elemen #mouse
."
P.S. Don't put event handlers anywhere except the `#mouse` element. | ||
P.P.S. Don't modify HTML/CSS, the approach should be generic and work with any element. | ||
P.S. Jangan letakkan event handler dimanapun kecuali elemen `#mouse`. | ||
P.P.S. Jangan modif HTML/CSS, pendekatannya harus umum dan bekerja dengan elemen manapun. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modif bisa diubah menjadi kata yang lebih baku seperti ubah atau modifikasi sekalian.
Please make the requested changes. After it, add a comment "/done". |
/done |
Thank you 💖 I updated the Progress Issue #1 🎉 🎉 🎉 |
No description provided.