Skip to content

Commit 8c69c64

Browse files
committed
bump sidecar
1 parent 4689a87 commit 8c69c64

File tree

8 files changed

+15
-11
lines changed

8 files changed

+15
-11
lines changed

.storybook/webpack.config.js renamed to .storybook/_webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ module.exports = (baseConfig, env, defaultConfig) => {
55

66
// defaultConfig.resolve.alias['../src/index'] = path.resolve(__dirname, '../dist/es2015/index.js')
77

8-
return defaultConfig;
8+
return baseConfig;
99
};

_tests/FocusLock.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,15 @@ describe('react-focus-lock', () => {
600600
expect(document.activeElement.innerHTML).to.be.equal('action');
601601
});
602602

603-
it('MoveFocusInside works without FocusLock', () => {
603+
it('MoveFocusInside works without FocusLock', async () => {
604604
mount(<MoveFocusInside>
605605
<div>text
606606
<button>action</button>
607607
text
608608
</div>
609609
</MoveFocusInside>);
610+
expect(document.activeElement.innerHTML).not.to.be.equal('action');
611+
await tick();
610612
expect(document.activeElement.innerHTML).to.be.equal('action');
611613
});
612614

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,6 @@
9696
"focus-lock": "^0.6.4",
9797
"prop-types": "^15.6.2",
9898
"react-clientside-effect": "^1.2.1",
99-
"use-sidecar": "^0.2.0"
99+
"use-sidecar": "^1.0.0"
100100
}
101101
}

src/Lock.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function FocusLock(props) {
4141
}
4242
}, []);
4343

44-
// MEDUIM CALLBACKS
44+
// MEDIUM CALLBACKS
4545

4646
const onFocus = useCallback((event) => {
4747
if (isActive.current) {

src/MoveFocusInside.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function MoveFocusInside({ disabled: isDisabled, className, children }) {
1818
});
1919
};
2020

21-
React.useLayoutEffect(() => {
21+
React.useEffect(() => {
2222
disabled.current = isDisabled;
2323
moveFocus();
2424
}, [isDisabled]);

src/Trap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ function handleStateChangeOnClient(traps) {
205205
}
206206

207207
// bind medium
208-
mediumFocus.assignMedium(onFocus);
208+
mediumFocus.assignSyncMedium(onFocus);
209209
mediumBlur.assignMedium(onBlur);
210210
mediumEffect.assignMedium(cb => cb({
211211
moveFocusInside,

src/medium.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ export const mediumBlur = createMedium();
88

99
export const mediumEffect = createMedium();
1010

11-
export const mediumSidecar = createSidecarMedium();
11+
export const mediumSidecar = createSidecarMedium({
12+
async: true
13+
});

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13786,10 +13786,10 @@ url@^0.11.0:
1378613786
punycode "1.3.2"
1378713787
querystring "0.2.0"
1378813788

13789-
use-sidecar@^0.2.0:
13790-
version "0.2.0"
13791-
resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-0.2.0.tgz#4a25c17ccd7d48b763dd6aff82ac36452ef973a5"
13792-
integrity sha512-Lc/ufC5jwasJwWx+NTDgXzzBCw86XIbydKRieE19auvu5D6nTqE6cz6TT9DNCtVnFprGoV3FzsAYVdc+uLQ0lA==
13789+
use-sidecar@^1.0.0:
13790+
version "1.0.0"
13791+
resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.0.0.tgz#29e6d33e9eb58577b821a8ff53767302fde5ac8e"
13792+
integrity sha512-j3mTfU91uqwVeG/zcICvb+rWt9PnBCJPiVNrpI3Vlu/VxIp8Rnf7yJ+gxHDrLzsEKKWaXozUWhkU3c3AlVPD2Q==
1379313793
dependencies:
1379413794
detect-node "^2.0.4"
1379513795
tslib "^1.9.3"

0 commit comments

Comments
 (0)