button.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <link href="../../../dist/css/bootstrap.min.css" rel="stylesheet">
  7. <title>Button</title>
  8. </head>
  9. <body>
  10. <div class="container">
  11. <h1>Button <small>Bootstrap Visual Test</small></h1>
  12. <button type="button" class="btn btn-primary" data-bs-toggle="button" aria-pressed="false" autocomplete="off">
  13. Single toggle
  14. </button>
  15. <p>For checkboxes and radio buttons, ensure that keyboard behavior is functioning correctly.</p>
  16. <p>Navigate to the checkboxes with the keyboard (generally, using <kbd>TAB</kbd> / <kbd>SHIFT + TAB</kbd>), and ensure that <kbd>SPACE</kbd> toggles the currently focused checkbox. Click on one of the checkboxes using the mouse, ensure that focus was correctly set on the actual checkbox, and that <kbd>SPACE</kbd> toggles the checkbox again.</p>
  17. <div class="btn-group" data-bs-toggle="buttons">
  18. <label class="btn btn-primary active">
  19. <input type="checkbox" checked autocomplete="off"> Checkbox 1 (pre-checked)
  20. </label>
  21. <label class="btn btn-primary">
  22. <input type="checkbox" autocomplete="off"> Checkbox 2
  23. </label>
  24. <label class="btn btn-primary">
  25. <input type="checkbox" autocomplete="off"> Checkbox 3
  26. </label>
  27. </div>
  28. <p>Navigate to the radio button group with the keyboard (generally, using <kbd>TAB</kbd> / <kbd>SHIFT + TAB</kbd>). If no radio button was initially set to be selected, the first/last radio button should receive focus (depending on whether you navigated "forward" to the group with <kbd>TAB</kbd> or "backwards" using <kbd>SHIFT + TAB</kbd>). If a radio button was already selected, navigating with the keyboard should set focus to that particular radio button. Only one radio button in a group should receive focus at any given time. Ensure that the selected radio button can be changed by using the <kbd>←</kbd> and <kbd>→</kbd> arrow keys. Click on one of the radio buttons with the mouse, ensure that focus was correctly set on the actual radio button, and that <kbd>←</kbd> and <kbd>→</kbd> change the selected radio button again.</p>
  29. <div class="btn-group" data-bs-toggle="buttons">
  30. <label class="btn btn-primary active">
  31. <input type="radio" name="options" id="option1" autocomplete="off" checked> Radio 1 (preselected)
  32. </label>
  33. <label class="btn btn-primary">
  34. <input type="radio" name="options" id="option2" autocomplete="off"> Radio 2
  35. </label>
  36. <label class="btn btn-primary">
  37. <input type="radio" name="options" id="option3" autocomplete="off"> Radio 3
  38. </label>
  39. </div>
  40. </div>
  41. <script src="../../dist/dom/event-handler.js"></script>
  42. <script src="../../dist/dom/selector-engine.js"></script>
  43. <script src="../../dist/dom/data.js"></script>
  44. <script src="../../dist/base-component.js"></script>
  45. <script src="../../dist/button.js"></script>
  46. </body>
  47. </html>