Skip to content
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

Wizard: TOC should be first in the markup for accessibility #4211

Closed
ebruchez opened this issue Oct 14, 2019 · 10 comments
Closed

Wizard: TOC should be first in the markup for accessibility #4211

ebruchez opened this issue Oct 14, 2019 · 10 comments

Comments

@ebruchez
Copy link
Collaborator

ebruchez commented Oct 14, 2019

+1 from customer

See also "Wizard: navigate pages with the keyboard #4210".

Need to backport to 2018.2.

@ebruchez
Copy link
Collaborator Author

ebruchez commented Jan 16, 2020

Currently, we show the TOC last because in wizard.xbl it needs access to variables that are defined earlier. We position the TOC first with CSS.

  • .xbl-fr-wizard is display: table; direction: rtl right now to fix the order
  • we need to look into making the TOC first in the markup
    • can we do this in wizard.xbl?
    • if not, any other way, such as moving the markup later in the pipeline?

@ebruchez
Copy link
Collaborator Author

Actually it's the opposite: the variables are in the TOC area, but they depend on getting the state of the xf:switch using case(). So we placed the switch first, and the TOC second.

@ebruchez
Copy link
Collaborator Author

Dependencies of the variables on the view:

  • case() for the top-level switch only
  • xxf:is-control-relevant() for $nav-section-or-grid-ids
  • xxf:binding() for $top-level-section-id

We could figure out the relevance and bindings of the sections by creating a separate, internal hierarchy of groups pointing just to the sections and grids, putting this first, and interrogating that.

For case(), currently the switch state only toggles via xf:toggle, although we have an optional caseref/sectionref since #1950 (but it's not used by us at this point).

We toggle:

  • initially
  • prev/next buttons
  • click on TOC

@ebruchez
Copy link
Collaborator Author

Since we store the case id anyway, and the current case is only changed via actions, we should be able to use xxf:instance('local')/current-case-id to replace case(). Actually we can't, because we want the top-level case id. But we could store that as well.

@ebruchez
Copy link
Collaborator Author

Can we use the bind() function instead of creating a "separate, internal hierarchy of groups" as mentioned above?

@ebruchez
Copy link
Collaborator Author

xxf:is-control-relevant() applies to $nav-section-or-grid-ids, which are statically determined:

  • if no subsections navigation
    • only top-level sections, repeated or not
  • if subsections navigation
    • top-level sections which
      • don't have nested sections
      • OR have @subsections-nav = 'false'
      • OR are repeated
    • first-level subsection which
      • are not within a top-level section with @subsections-nav = 'false'
      • AND are not within a top-level repeated section
    • grid within a top-level section which
      • are not within a top-level section with @subsections-nav = 'false'
      • AND are not within a top-level repeated section
      • AND have sibling sections

So bind() would resolve all of those, since none of those are within repeated content.

@ebruchez
Copy link
Collaborator Author

Gist with a test form

@ebruchez
Copy link
Collaborator Author

ebruchez commented Jan 22, 2020

Confirming that bind() works.

@ebruchez
Copy link
Collaborator Author

ebruchez commented Jan 23, 2020

We also use:

  • the index() function for repeated top-level sections
  • and the xxf:binding() function in a couple of other places
  • test again top-level repeated sections
  • 2018.2 backport (hoping this won't be needed!)
    • diff wizard.xbl of 2018.2 and wizard.xbl just before this fix to see how hard it will be
    • handle non-repeated grids which don't have a binding as our use of bind() won't work there; should be possible to just use the enclosing section's relevance

@ebruchez
Copy link
Collaborator Author

Like #3455, it'd be nice if we had a native data model for the wizard.

ebruchez added a commit that referenced this issue Jan 23, 2020
ebruchez added a commit that referenced this issue Jan 23, 2020
ebruchez added a commit that referenced this issue Jan 23, 2020
ebruchez added a commit that referenced this issue Jan 23, 2020
ebruchez added a commit that referenced this issue Jan 23, 2020
ebruchez pushed a commit that referenced this issue Jan 31, 2020
@ebruchez ebruchez added this to To review in Orbeon Forms 2020.1 via automation Aug 20, 2020
Orbeon Forms 2020.1 automation moved this from To review to Done Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

No branches or pull requests

1 participant