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

navigation: screen reader read order and dom order bad #2589

Closed
oliverfoster opened this issue Nov 18, 2019 · 2 comments · Fixed by adaptlearning/adapt-contrib-core#77
Closed
Assignees

Comments

@oliverfoster
Copy link
Member

oliverfoster commented Nov 18, 2019

Subject of the issue

Because nav buttons are floated their visual appearance is inverse to the dom order

Environment

  • Framework: >=4

Requirements

  • Allow item order to be controlled in the json
  • Left, right and middle containers
  • API for adding/removing/sorting/modifying items
@kirsty-hames
Copy link
Contributor

kirsty-hames commented Aug 4, 2020

It is possible to display nav elements in their dom order if we use display flex instead of floats.

See core changes below.

.nav {
  &__inner {
    display: flex;
    align-items: center;
  }

  &__back-btn {
    //.u-float-left;
  }

  &__drawer-btn {
    //.u-float-right;
    margin-left: auto;
    .dir-rtl & {
      margin-left: 0;
      margin-right: auto;
    }
  }
}

Instead of using floats to create the navigation split we can use margin. Both .nav__back-btn and .nav__drawer-btn are rendered even if they're not visually displayed and we can assume anything floated right would display after .nav__drawer-btn.

nav_elements_using_display_flex

In addition we would no longer need the float properties on the following contrib extensions:
adapt-contrib-languagePicker
adapt-contrib-pageLevelProgress
(Just to note, even without the floats being removed this doesn't impact the layout)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants