Skip to content

Commit

Permalink
chore(TMC-28658): Add a data attribute to detect DS drawer when open (#…
Browse files Browse the repository at this point in the history
…5324)

Co-authored-by: Geoffroy Baccarini <[email protected]>
  • Loading branch information
Gbacc and Geoffroy Baccarini authored Jun 4, 2024
1 parent 38588b3 commit 95bb74f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-tigers-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@talend/design-system": patch
---

Design system drawer now has a data attribute to identify when it is opened
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ exports[`FloatingDrawer should render a11y html 1`] = `
<div
aria-label="label is required"
class="theme-drawer"
data-drawer-visible="true"
data-test="drawer"
data-testid="drawer"
id="drawer-42"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { useEffect, useState, cloneElement } from 'react';
import { cloneElement, useEffect, useState } from 'react';
import type { CSSProperties, HTMLAttributes, ReactElement, ReactNode } from 'react';
import { Transition } from 'react-transition-group';

import { useId } from '../../../../useId';
import { PrimitiveDrawer } from '../../Primitive/PrimitiveDrawer';

import theme from './FloatingDrawer.module.scss';
import { useId } from '../../../../useId';

type WithDisclosure = {
disclosure: ReactElement;
Expand Down Expand Up @@ -90,6 +91,7 @@ export const FloatingDrawer = ({
<div
data-test="drawer"
data-testid="drawer"
data-drawer-visible
id={uuid}
role="dialog"
aria-label={props['aria-label']}
Expand Down

0 comments on commit 95bb74f

Please sign in to comment.