Skip to content

Commit 8753827

Browse files
Merge pull request #116 from LottieFiles/develop
Aria labels for controls
2 parents e1a0588 + 2b27a97 commit 8753827

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

.changeset/red-clouds-help.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 3.4.9
4+
5+
### Patch Changes
6+
7+
- 730c3b2: add aria-label to Controls
8+
- 32e0728: fix double animation with react 18 strict mode
9+
- cd94951: chore: version bump
10+
311
## 3.4.6
412

513
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@lottiefiles/react-lottie-player",
3-
"version": "3.4.7",
3+
"version": "3.4.9",
44
"description": "Lottie web player wrapper for React",
55
"main": "dist/lottie-react.js",
66
"module": "dist/lottie-react.esm.js",

src/Controls.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import './Styles.css';
55
import * as React from 'react';
66

77
import { ColorPicker } from './ColorPicker';
8-
import { PlayerState } from './Player';
8+
import { PlayerEvent, PlayerState } from './Player';
99
import { Popover } from './Popover';
1010
import { Seeker } from './Seeker';
1111

@@ -83,6 +83,7 @@ export class Controls extends React.Component<IControlProps, { mouseDown: boolea
8383
{showPlayButton && (
8484
<div
8585
role="button"
86+
aria-label={playerState === PlayerState.Playing ? PlayerEvent.Pause : PlayerEvent.Play}
8687
tabIndex={0}
8788
onClick={() => {
8889
if (playerState === PlayerState.Playing) {
@@ -125,6 +126,7 @@ export class Controls extends React.Component<IControlProps, { mouseDown: boolea
125126
<div
126127
tabIndex={0}
127128
role="button"
129+
aria-label={PlayerEvent.Stop}
128130
onClick={() => stop && stop()}
129131
onKeyDown={() => stop && stop()}
130132
className={playerState === PlayerState.Stopped ? 'lf-player-btn active' : 'lf-player-btn'}
@@ -184,6 +186,7 @@ export class Controls extends React.Component<IControlProps, { mouseDown: boolea
184186
{showRepeatButton && (
185187
<div
186188
role="button"
189+
aria-label={PlayerEvent.Loop}
187190
tabIndex={0}
188191
onClick={() => {
189192
if (instance && setLoop) {

src/Seeker.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export class Seeker extends React.Component<ISeekerProps> {
8585
id="track"
8686
className="lf-progress"
8787
name="progress"
88+
aria-label="progress"
8889
type="range"
8990
min="0"
9091
max="100"

0 commit comments

Comments
 (0)