https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • m

    mysterious-toddler-20573

    07/24/2022, 3:02 PM
    clearly this channel doesn't understand modern HTML
  • h

    hundreds-camera-24900

    07/24/2022, 3:02 PM
    it would be a post still - the actual mechanics of the form submission aren't changing
  • h

    hundreds-camera-24900

    07/24/2022, 3:02 PM
    I'm just using hx-post over button type=submit
  • g

    gorgeous-airport-54386

    07/24/2022, 3:02 PM
    a screenreader user will hear:
    Copy code
    Username, text
    Password, text
    Login, link
    Sign up, link
    is this a login form or a signup form?
  • m

    mysterious-toddler-20573

    07/24/2022, 3:03 PM
    Copy code
    html
    <div class="paragraph">
      <div class="button">Go To The Next Page</div>
      <div class="link">Submit Feedback</div>
    </div>
  • h

    hundreds-camera-24900

    07/24/2022, 3:03 PM
    I know very little about screenreaders so that is exactly what I'm looking for
  • m

    mysterious-toddler-20573

    07/24/2022, 3:03 PM
    OK, I will cease hurting the discussion now
  • h

    hundreds-camera-24900

    07/24/2022, 3:03 PM
    what are the cases where using a link actually hurts the UX
  • h

    hundreds-camera-24900

    07/24/2022, 3:04 PM
    so now the component becomes
  • g

    gorgeous-airport-54386

    07/24/2022, 3:04 PM
    Copy code
    css
    .wrapper::before { content: "Go To The Next Page" }
    .wrapper::after  { content: "Submit Feedback" }
  • h

    hundreds-camera-24900

    07/24/2022, 3:05 PM
    Copy code
    html
     <button type=submit class="sr-only"> {{label}}</button>
    <a class="btn-primary" hx-post="place" hx-target="closest form"> {{label]]</a>
  • g

    gorgeous-airport-54386

    07/24/2022, 3:05 PM
    https://www.buttoncheatsheet.com/
  • g

    gorgeous-airport-54386

    07/24/2022, 3:07 PM
    Copy code
    html
    {% set tag to "a" if link else "button" %}
    <{{tag}} class="btn-primary" hx-post="place" hx-target="closest form"> {{label}}</{{tag}}>
  • g

    gorgeous-airport-54386

    07/24/2022, 3:08 PM
    Copy code
    Username, text
    Password, text
    Login, pushbutton
    Sign up, link
    with proper html, the purpose of the form is clear
  • h

    hundreds-camera-24900

    07/24/2022, 3:09 PM
    so that's an interesting resource - but the link section says:
  • h

    hundreds-camera-24900

    07/24/2022, 3:09 PM
    Not keyboard focusable No key events by default link instead of button role Shows wrong cursor on hover
  • h

    hundreds-camera-24900

    07/24/2022, 3:09 PM
    links are keyboard focusable and do show the right cursor by default
  • h

    hundreds-camera-24900

    07/24/2022, 3:10 PM
    the role is a good point - that is something you'd have to manage manually
  • h

    hundreds-camera-24900

    07/24/2022, 3:11 PM
    What key events am I missing - they both support keyup/keydown
  • g

    gorgeous-airport-54386

    07/24/2022, 3:11 PM
    links show pointing hand whereas buttons show normal arrow
  • h

    hundreds-camera-24900

    07/24/2022, 3:12 PM
    do they? I must have a local sheet to override that globally
  • h

    hundreds-camera-24900

    07/24/2022, 3:12 PM
    not sure I've ever wanted a button to not show a pointer
  • g

    gorgeous-airport-54386

    07/24/2022, 3:13 PM
    looking for more on the key events thing
  • h

    hundreds-camera-24900

    07/24/2022, 3:14 PM
    screen readers use role right?
  • g

    gorgeous-airport-54386

    07/24/2022, 3:16 PM
    buttons can be triggered with the space key
  • g

    gorgeous-airport-54386

    07/24/2022, 3:16 PM
    with links it just scrolls down
  • h

    hundreds-camera-24900

    07/24/2022, 3:17 PM
    interesting
  • g

    gorgeous-airport-54386

    07/24/2022, 3:17 PM
    Adrian Roselli February 14, 2020 > Key handling note on native controls: > > events triggered by the space bar fire when the key is released (or onkeyup); > events triggered by the Enter key will fire the event as soon as you press the key down (or onkeydown). > > I have done testing with keyboard-only and screen reader users and while they may not know this behavior, they generally react with a bit of surprise when it is not followed. If you are trying to re-create a native control, make sure the keyboard handlers correspond. A pen where you can try it yourself. https://css-tricks.com/a-complete-guide-to-links-and-buttons/
  • h

    hundreds-camera-24900

    07/24/2022, 3:17 PM
    I've only ever used enter for both
  • g

    gorgeous-airport-54386

    07/24/2022, 3:17 PM
    i use space for buttons regularly
1...760761762...1146Latest