Linkable buttons

Aperta
#75 9 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
javascript, react

Direzione di ricerca

Inizia confrontando i pattern documentati per load-more, masthead, site-menu, tabs e buttons-and-CTAs, quindi esamina il comportamento attuale dei componenti Button e Link menzionato nell’issue. Il lavoro sarà considerato completato quando sarà stato concordato un pattern per tabs, toggles e pagination e saranno state aggiornate le indicazioni pertinenti sui componenti; questa issue non definisce un’implementazione né dei test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

needs discussion

Hello!

I think this is slightly different than https://github.com/bbc/gef-docs/issues/59 but let me know if it overlaps.

I'm looking at a few of the use-cases where links are being used in place of buttons and trying to see if there is a general improvement that should be applied to them.

Tabs

One use-case are tabs that link to standalone pages, such as the date tabs on:

Some similar implementations offer links instead of buttons if JS is disabled, but that prevents a user from opening one of the tabs in a new browser tab (assuming such a feature is still useful to our users)

More toggle/link

Another use-case is the More toggle in the global navigation, which links to the footer page fragment to cater for users without javascript, with the JS enhancing it opening the 'More' drawer. This is read out as a link by assistive tech.

Pagination

Some usage of pagination may also be considered included in this if - when javascript is enabled - the pagination links change the content in the page rather than linking to a new page (although they may change the url and title tag which could mean a link is fine)


Looking through the current GEF documentation:


Would you agree that these tabs/toggles should be pronounced as buttons and not as links and function in the same way as buttons do (https://bbc.github.io/gef-docs/components/buttons-and-ctas/#recommended-behaviour)? Or should they still be links and maybe (for the tabs example) change the url and title tag?

There are a few options we can see to achieve this, but non seem ideal.

  • Replace the anchor elements as buttons when JS activates (we are using React which makes this easier) which could offer a strange experience if the JS activation takes some time and would prevent the user loading individual pages in a new tab.
  • Make a link act like a button using role=button and simulating a click even when the space button is pressed - I can guess at this being not widely supported or having some other quirk?

Any thoughts on the above?

At the moment I'm not trying to implement any of these patterns (with the exception of maybe the More button in the masthead) but looking at the interface and behaviour of generic Button and Link components that may be used as part of such a pattern.

Lingua principale
JavaScript
Stelle
50
Fork
19
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bbc/gel

Tutte le issue di bbc/gel

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.