Skip to content

Commit d0312f2

Browse files
committed
Resolve comments, update React to 19.2
1 parent 16ba12e commit d0312f2

File tree

4 files changed

+21
-23
lines changed

4 files changed

+21
-23
lines changed

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,6 @@ If you are adding this library to your existing application, add `amazon-chime-s
5151
npm install --save amazon-chime-sdk-component-library-react amazon-chime-sdk-js styled-components styled-system
5252
```
5353

54-
## React Version Compatibility
55-
56-
This library supports React 17, 18, and 19. The minimum required versions are:
57-
- React >= 17.0.1
58-
- React DOM >= 17.0.1
59-
60-
For React 19 support, ensure you're using:
61-
- React ^19.0.0
62-
- React DOM ^19.0.0
63-
- TypeScript ^5.0.0 (recommended for full React 19 JSX support and modern type definitions)
64-
6554
Otherwise clone the repo and install the dependencies.
6655

6756
## Contributing to the component library

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@
101101
"prompt-sync": "^4.2.0",
102102
"prop-types": "^15.8.1",
103103
"puppeteer": "^2.1.1",
104-
"react": "^19.0.0",
104+
"react": "^19.2.0",
105105
"react-docgen-typescript-loader": "^3.7.2",
106-
"react-dom": "^19.0.0",
107-
"react-is": "^19.0.0",
106+
"react-dom": "^19.2.0",
107+
"react-is": "^19.2.0",
108108
"resize-observer-polyfill": "^1.5.1",
109109
"rimraf": "^2.6.3",
110110
"rollup": "^2.26.3",

src/components/ui/PopOver/index.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,29 @@ export const PopOver: FC<React.PropsWithChildren<PopOverProps>> = ({
113113

114114
for (let i = 0; i < nodes.length; i++) {
115115
if (nodes[i] === currentElement) {
116-
if (direction === 'down' && i !== nodes.length - 1) {
116+
if (direction === 'down') {
117+
if (i === nodes.length - 1) {
118+
return; // At last element, don't wrap around
119+
}
117120
nodes[i + 1].focus();
118121
return;
119122
}
120123

121-
if (direction === 'up' && i > 0) {
124+
if (direction === 'up') {
125+
if (i === 0) {
126+
return; // At first element, don't wrap around
127+
}
122128
nodes[i - 1].focus();
123129
return;
124130
}
125-
break;
131+
return;
126132
}
127133
}
128-
nodes[0].focus();
134+
135+
// If current element not found in nodes, focus first node
136+
if (nodes.length > 0) {
137+
nodes[0].focus();
138+
}
129139
}
130140
};
131141

@@ -149,8 +159,7 @@ export const PopOver: FC<React.PropsWithChildren<PopOverProps>> = ({
149159
};
150160

151161
const handlePopOverClick = () => {
152-
const newIsOpen = !isOpen;
153-
setIsOpen(newIsOpen);
162+
setIsOpen(!isOpen);
154163
if (onPopOverClick) {
155164
onPopOverClick(isOpen);
156165
}

0 commit comments

Comments
 (0)