A place to cache linked articles (think custom and personal wayback machine)
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

2 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. title: You can't capture the nuance of my form fields
  2. url: https://drewdevault.com/2021/06/27/You-cant-capture-the-nuance.html
  3. hash_url: 1a6493b2d0049ae88f2b331a990a85b8
  4. <p>Check out this text box:</p>
  5. <style>
  6. textarea {
  7. width: 100%;
  8. }
  9. </style>
  10. <p><textarea rows="10" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">Consectetur qui consequatur voluptatibus voluptatem sit sint perspiciatis. Eos aspernatur ad laboriosam quam numquam quo. Quia reiciendis illo quo praesentium. Dolor porro et et sit dolorem quisquam totam quae.
  11. Ea molestias a aspernatur dignissimos suscipit incidunt. Voluptates in vel qui quaerat. Asperiores vel sit rerum est ipsam. Odio aut aut voluptate qui voluptatem.
  12. Quia consequatur provident fugiat voluptatibus consequatur. Est sunt aspernatur velit. Officiis a dolorum accusantium. Sint est ut inventore.</textarea></p>
  13. <p>Here are some of the nuances of using this text box on my operating system
  14. (Linux) and web browser (Firefox):</p>
  15. <ul>
  16. <li>Double clicking selects a word, and triple-clicking selects the whole line. If
  17. I double- or triple-click-and-hold, I can drag the mouse to expand the
  18. selection word-wise or line-wise, not just character-wise. This works with the
  19. paragraphs of text in the body of this blog post, too.</li>
  20. <li>Holding control and pressing right will move move word-wise through the file.
  21. It always moves to the start or end of the next or prior word, so pressing
  22. “control+left, control+left, control+right” will end up in a different
  23. position than “control+left” alone. Adding “shift” to any of these will mutate
  24. the text selection.</li>
  25. <li>Clicking any of the whitespace after the end of the text will put the cursor
  26. after the last character, even if you click to the left of the last character.
  27. This makes it easy to start appending text to the end.</li>
  28. <li>Clicking and dragging from any point, I can drag the mouse straight upward,
  29. exceeding the bounds of the text box or even the entire web browser, to select
  30. all text from that point to the start of the text box. (Thanks minus for
  31. mentioning this one)</li>
  32. <li>Selecting text and middle clicking anywhere will paste the text at the clicked
  33. location. This uses a separate, distinct clipboard from the one accessed with
  34. ctrl+c/ctrl+v. I can also use shift+insert to paste text from this secondary
  35. clipboard (this is called the “primary selection”).</li>
  36. </ul>
  37. <p>I rely on all of these nuances when I use form controls in my everyday life.
  38. This is just for English, by the way. I often type in Japanese, which has an
  39. entirely alien set of nuances. Here’s what that looks like on Android (mobile is
  40. another beast entirely, too!):</p>
  41. <video src="https://l.sr.ht/u274.webm" muted autoplay loop controls>
  42. If you're seeing this, your browser doesn't support HTML5 video, or webm, idk.
  43. </video>
  44. <p>Here’s another control:</p>
  45. <select>
  46. <option>Alabama</option>
  47. <option>Alaska</option>
  48. <option>Arizona</option>
  49. <option>Arkansas</option>
  50. <option>California</option>
  51. <option>Colorado</option>
  52. <option>Connecticut</option>
  53. <option>Delaware</option>
  54. <option>Florida</option>
  55. <option>Georgia</option>
  56. <option>Hawaii</option>
  57. <option>Idaho</option>
  58. <option>Illinois</option>
  59. <option>Indiana</option>
  60. <option>Iowa</option>
  61. <option>Kansas</option>
  62. <option>Kentucky</option>
  63. <option>Louisiana</option>
  64. <option>Maine</option>
  65. <option>Maryland</option>
  66. <option>Massachusetts</option>
  67. <option>Michigan</option>
  68. <option>Minnesota</option>
  69. <option>Mississippi</option>
  70. <option>Missouri</option>
  71. <option>Montana</option>
  72. <option>Nebraska</option>
  73. <option>Nevada</option>
  74. <option>New Hampshire</option>
  75. <option>New Jersey</option>
  76. <option>New Mexico</option>
  77. <option>New York</option>
  78. <option>North Carolina</option>
  79. <option>North Dakota</option>
  80. <option>Ohio</option>
  81. <option>Oklahoma</option>
  82. <option>Oregon</option>
  83. <option>Pennsylvania</option>
  84. <option>Rhode Island</option>
  85. <option>South Carolina</option>
  86. <option>South Dakota</option>
  87. <option>Tennessee</option>
  88. <option>Texas</option>
  89. <option>Utah</option>
  90. <option>Vermont</option>
  91. <option>Virginia</option>
  92. <option>Washington</option>
  93. <option>West Virginia</option>
  94. <option>Wisconsin</option>
  95. <option>Wyoming</option>
  96. </select>
  97. <p>There’s an invisible edit buffer, so I can type “Pennsylvania” (or just P) to
  98. select what I want. I can type “New” and then press down to select “New Jersey”.
  99. If I make a mistake and I’ve kept track of what I’ve typed in my head, I can use
  100. backspace to make a correction, and it just works. I have lived in both of these
  101. places, and worked both of these keystrokes into my muscle memory. Filling out a
  102. form with my address on it and using an input box like this to select my state
  103. of residence takes me less than a second.</p>
  104. <p>You cannot capture all of this nuance in a home-grown form control, or even
  105. anything close to it, but many JavaScript programmers do it anyway. Whenever I
  106. encounter a custom form control, the time required to complete the form
  107. increases from under a second to as much as a minute.</p>
  108. <p>For myself, this is just very annoying. Imagine the same situation if you were
  109. blind. The standard form inputs work everywhere, and are designed with
  110. accessibility in mind, so you’re used to them and can easily fill in forms which
  111. use the standard browser controls. But, when you hit a JavaScript-powered
  112. organic cage-free non-GMO text box, you’re screwed.</p>
  113. <p>There are hundreds of little nuances that users learn to use their computers
  114. efficiently. The exact features a user relies on will vary between operating
  115. systems, browsers, hardware, natural languages, physical ability, and personal
  116. preferences and experience. There are dozens of tiny workflows that people
  117. depend on every day that have never even occurred to you.</p>
  118. <p>Making a custom form control with JavaScript is going to make life worse for a
  119. lot of people. Just don’t do it. The browser’s built-in controls are quite
  120. sufficient.</p>