Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions www/src/components/rotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ class Rotator extends Component {

render() {
const { text, pluginName } = this.props.items[this.state.item]

const enableSlider = this.shouldAnimate() && this.intervalId

return (
Expand Down Expand Up @@ -142,16 +141,14 @@ class Rotator extends Component {
whiteSpace: `nowrap`,
display: `inline-block`,
}}
id="headline-slider"
ref={this.sliderContainer}
aria-live={this.intervalId ? `off` : `polite`}
>
{!enableSlider ? (
<>{text}</>
) : (
<Slider
items={[text]}
color={`#000`}
getSize={size => this.setState({ size })}
Copy link
Contributor

Choose a reason for hiding this comment

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

Argh! Thanks for catching that @wardpeet! 🙏

/>
<Slider items={[text]} color={`#000`} />
)}
</span>
</span>
Expand All @@ -174,13 +171,18 @@ class Rotator extends Component {
{` `}
for that.
</p>
<button css={{ ...controlButtonStyles }} onClick={this.decrementItem}>
<button
css={{ ...controlButtonStyles }}
onClick={this.decrementItem}
aria-controls="headline-slider"
>
<MdNavigateBefore aria-hidden="true" />
<span css={srOnly}>Previous</span>
</button>
<button
css={{ ...controlButtonStyles, left: `auto`, right: 0 }}
onClick={this.incrementItemAndClearInterval}
aria-controls="headline-slider"
>
<MdNavigateNext aria-hidden="true" />
<span css={srOnly}>Next</span>
Expand Down