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

resolve page scroll when user selects last item #232

Merged
merged 3 commits into from
Aug 8, 2022
Merged

Conversation

chris-steele
Copy link
Contributor

To resolve #231

@oliverfoster
Copy link
Member

oliverfoster commented Jul 19, 2022

Could you try removing these instead please?

$left.toggleClass('u-visibility-hidden', isAtStart);
$right.toggleClass('u-visibility-hidden', isAtEnd);

It's probably because the focus is going from the button. Assigning it elsewhere usually causes the screen reader to read the a11y-focuser element. It was admittedly pretty bad practise for me to include that element / suggest that technique in the first place.

Copy link
Member

@oliverfoster oliverfoster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See suggestion

@guywillis
Copy link
Contributor

Both solutions resolve the page jump.

The suggestion from Ollie displays the previous button on the first slide and the next button on the last slide. Whilst selecting these buttons causes no errors within the build it is potentially confusing from a UI perspective and almost certainly confusing from a screen reader perspective - the buttons can be tabbed into and are read out.

Tested with NVDA.

@oliverfoster
Copy link
Member

Both solutions resolve the page jump.

The suggestion from Ollie displays the previous button on the first slide and the next button on the last slide. Whilst selecting these buttons causes no errors within the build it is potentially confusing from a UI perspective and almost certainly confusing from a screen reader perspective - the buttons can be tabbed into and are read out.

Tested with NVDA.

They should be read out as disabled.

@oliverfoster
Copy link
Member

oliverfoster commented Jul 28, 2022

@guywillis Let us know about the nvda disabled buttons when you get a chance pls

@guywillis
Copy link
Contributor

NVDA does not read the buttons as disabled.

When testing, I have only removed these two lines as mentioned above:

$left.toggleClass('u-visibility-hidden', isAtStart);
$right.toggleClass('u-visibility-hidden', isAtEnd);

Screenshot of the narrative controls in the DOM for the first item of three.

Screenshot 2022-07-29 at 11 50 42

@oliverfoster
Copy link
Member

oliverfoster commented Aug 1, 2022

@chris-steele can you replace

$left.toggleClass('u-visibility-hidden', isAtStart);
$right.toggleClass('u-visibility-hidden', isAtEnd);

with

    a11y.toggleEnabled($left, !isAtStart);
    a11y.toggleEnabled($right, !isAtEnd);

instead?
narrative

@guywillis
Copy link
Contributor

Works a charm.

Tested with NVDA

@chris-steele
Copy link
Contributor Author

Done and thanks both

js/NarrativeView.js Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@oliverfoster oliverfoster merged commit f4cf921 into master Aug 8, 2022
@oliverfoster oliverfoster deleted the issue/231 branch August 8, 2022 10:01
github-actions bot pushed a commit that referenced this pull request Aug 8, 2022
## [7.2.2](v7.2.1...v7.2.2) (2022-08-08)

### Fix

* Resolve page scroll when user selects last item (#232) ([f4cf921](f4cf921)), closes [#232](#232)
@github-actions
Copy link

github-actions bot commented Aug 8, 2022

🎉 This PR is included in version 7.2.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit to robertmausser/adapt-contrib-narrative that referenced this pull request Jul 10, 2023
# [5.1.0](v5.0.2...v5.1.0) (2023-07-10)

### chore

* added package.json ([c80dc92](c80dc92))
* added package.json ([eef9b5d](eef9b5d)), closes [#3072](https://github.com/robertmausser/adapt-contrib-narrative/issues/3072)

### Fix

* _globals schema nesting (adaptlearning#253) ([2cdb7ae](2cdb7ae)), closes [adaptlearning#253](https://github.com/robertmausser/adapt-contrib-narrative/issues/253)
* Added gitignore for release automation (adaptlearning#237) ([bacab53](bacab53)), closes [adaptlearning#237](https://github.com/robertmausser/adapt-contrib-narrative/issues/237)
* Added release automation (adaptlearning#234) ([dd45d5a](dd45d5a)), closes [adaptlearning#234](https://github.com/robertmausser/adapt-contrib-narrative/issues/234)
* Bump http-cache-semantics from 4.1.0 to 4.1.1 (adaptlearning#246) ([b613166](b613166)), closes [adaptlearning#246](https://github.com/robertmausser/adapt-contrib-narrative/issues/246)
* Convert to JSX, make progress indicators non-interactive (fixes adaptlearning#238 adaptlearning#244) ([7f7977a](7f7977a)), closes [adaptlearning#238](https://github.com/robertmausser/adapt-contrib-narrative/issues/238) [adaptlearning#244](https://github.com/robertmausser/adapt-contrib-narrative/issues/244)
* Delay button update until after focus (fixes adaptlearning#261) (adaptlearning#266) ([949ee68](949ee68)), closes [adaptlearning#261](https://github.com/robertmausser/adapt-contrib-narrative/issues/261) [adaptlearning#266](https://github.com/robertmausser/adapt-contrib-narrative/issues/266)
* Move breakpoint to medium from large (adaptlearning#264) ([65b1517](65b1517)), closes [adaptlearning#264](https://github.com/robertmausser/adapt-contrib-narrative/issues/264)
* Move button labels to span tags (fixes adaptlearning#268) ([433b7f9](433b7f9)), closes [adaptlearning#268](https://github.com/robertmausser/adapt-contrib-narrative/issues/268)
* Narrative focus being pulled on mobile fix (fixes adaptlearning#258) ([b60f8dc](b60f8dc)), closes [adaptlearning#258](https://github.com/robertmausser/adapt-contrib-narrative/issues/258)
* Narrative item header level calculation (adaptlearning#257) ([c5abd1b](c5abd1b)), closes [adaptlearning#257](https://github.com/robertmausser/adapt-contrib-narrative/issues/257)
* Prevent scrolling of container (fixes adaptlearning#254) (adaptlearning#255) ([cb6a6e9](cb6a6e9)), closes [adaptlearning#254](https://github.com/robertmausser/adapt-contrib-narrative/issues/254) [adaptlearning#255](https://github.com/robertmausser/adapt-contrib-narrative/issues/255)
* Removed focus-rect (fixes adaptlearning#242) ([c3692de](c3692de)), closes [adaptlearning#242](https://github.com/robertmausser/adapt-contrib-narrative/issues/242)
* Replace narrative view with hotgraphic view on parent (adaptlearning#265) ([8db789a](8db789a)), closes [adaptlearning#265](https://github.com/robertmausser/adapt-contrib-narrative/issues/265)
* Resolve page scroll when user selects last item (adaptlearning#232) ([f4cf921](f4cf921)), closes [adaptlearning#232](https://github.com/robertmausser/adapt-contrib-narrative/issues/232)
* Strapline overflow fix (adaptlearning#247) ([b011f23](b011f23)), closes [adaptlearning#247](https://github.com/robertmausser/adapt-contrib-narrative/issues/247)
* Version numbers removed from Readme files ([47c8a59](47c8a59))

### New

* Issue and pr project addition automation (refs adaptlearning/adapt_framework#3315) (adaptlearning#233) ([b6836d6](b6836d6)), closes [adaptlearning#233](https://github.com/robertmausser/adapt-contrib-narrative/issues/233)
* Normalize icons globally ([6c75165](6c75165))
* Provide default instruction text (fixes adaptlearning#240) (adaptlearning#241) ([7d3e560](7d3e560)), closes [adaptlearning#240](https://github.com/robertmausser/adapt-contrib-narrative/issues/240) [adaptlearning#241](https://github.com/robertmausser/adapt-contrib-narrative/issues/241)

### onItemsActiveChange

* remove underscore from parameter and return early ([2eab40b](2eab40b))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

page scrolls when user selects last item
4 participants