Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 8ca4628

Browse files
committed
Switch workaround prop to opacity
This is to avoid having to do prefixing. If this turns out to be less reliable we will switch back to transform.
1 parent 0b19963 commit 8ca4628

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/composables/withWorkaround.spec.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("withWorkaround", () => {
3434

3535
it("should have default style", () => {
3636
const style = wrapper.childAt(0).props().style;
37-
assert.deepEqual(style, { transform: "scale(0.99)" });
37+
assert.deepEqual(style, { opacity: 0.9 });
3838
});
3939

4040
describe("during a transition", () => {
@@ -52,12 +52,12 @@ describe("withWorkaround", () => {
5252

5353
it("should perform a second transition", () => {
5454
const style = wrapper.childAt(0).props().style;
55-
assert.deepEqual(style, { transform: "scale(1.0)", transition: "transform 1ms linear 10ms" });
55+
assert.deepEqual(style, { opacity: 1.0, transition: "opacity 1ms linear 10ms" });
5656
});
5757

5858
describe("when second transition ends", () => {
5959
before(() => {
60-
wrapper.childAt(0).simulate("transitionEnd", { propertyName: "transform" });
60+
wrapper.childAt(0).simulate("transitionEnd", { propertyName: "opacity" });
6161
});
6262

6363
it("should call onTransitionStart", () => {

src/composables/withWorkaround.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export const withWorkaround = combine(
3535
) => {
3636
const workaroundProps: React.HTMLProps<HTMLSpanElement> = {
3737
key: "workaround",
38-
style: { transform: "scale(0.99)" },
38+
style: { opacity: 0.9 },
3939
};
4040
if (inTransition) {
4141
workaroundProps.onTransitionEnd = workaroundHandler;
42-
workaroundProps.style = { transform: "scale(1.0)", transition: `transform 1ms linear ${firstPropertyDelay}ms` };
42+
workaroundProps.style = { opacity: 1.0, transition: `opacity 1ms linear ${firstPropertyDelay}ms` };
4343
}
4444
return {
4545
children: [<span {...workaroundProps } />, ...Children.toArray(children)],

0 commit comments

Comments
 (0)