Skip to content

Commit 3547c65

Browse files
authored
chore: revert close button animation (#5946)
revert close button animation
1 parent c66f55b commit 3547c65

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

packages/compass-components/src/components/workspace-tabs/tab.spec.tsx

+8
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ describe('Tab', function () {
4444
.visible;
4545
});
4646

47+
it('should render the close tab button visible', async function () {
48+
expect(await screen.findByLabelText('Close Tab')).to.be.visible;
49+
});
50+
4751
it('should call "onClose" when the close button is clicked', async function () {
4852
expect(onCloseSpy.callCount).to.equal(0);
4953
const closeTabButton = await screen.findByLabelText('Close Tab');
@@ -74,6 +78,10 @@ describe('Tab', function () {
7478
);
7579
});
7680

81+
it('should render the close tab button hidden', async function () {
82+
expect(await screen.findByLabelText('Close Tab')).to.not.be.visible;
83+
});
84+
7785
// Focus visible is not working proper in jsdom environment
7886
it.skip('should render the close tab button visible when the tab is focused', async function () {
7987
const tabToFocus = await screen.findByRole('tab');

packages/compass-components/src/components/workspace-tabs/tab.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,11 @@ const tabSubtitleStyles = css({
170170
});
171171

172172
const closeButtonStyles = css({
173-
transition: tabTransition,
174-
transitionProperty: 'opacity, transform',
175-
transform: 'translateY(44px)',
176-
opacity: 0,
173+
visibility: 'hidden',
177174
});
178175

179176
const selectedCloseButtonStyles = css({
180-
transform: 'translateY(0)',
181-
opacity: 1,
177+
visibility: 'visible',
182178
});
183179

184180
type IconGlyph = Extract<keyof typeof glyphs, string>;

0 commit comments

Comments
 (0)