Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EuiDraggable, EuiDroppable should support the 'data-test-subj' property #1943

Merged
merged 2 commits into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Removed unused prop enum of `l` in `EuiButton` ([#1936](https://github.com/elastic/eui/pull/1936))
- Fixed `EuiSelect` browser event inconsistencies by normalizing `mouseup` propagation ([#1926](https://github.com/elastic/eui/pull/1926))
- Removed `children` as a required prop for `EuiOverlayMask` ([#1937](https://github.com/elastic/eui/pull/1937))
- `EuiDraggable`, `EuiDroppable` should support the `data-test-subj` property ([#1943](https://github.com/elastic/eui/pull/1943))

## [`11.0.1`](https://github.com/elastic/eui/tree/v11.0.1)

Expand Down
3 changes: 2 additions & 1 deletion src/components/drag_and_drop/draggable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const EuiDraggable: FunctionComponent<EuiDraggableProps> = ({
className,
spacing = 'none',
style,
'data-test-subj': dataTestSubj = 'draggable',
...rest
}) => {
const { cloneItems } = useContext(EuiDroppableContext);
Expand Down Expand Up @@ -85,7 +86,7 @@ export const EuiDraggable: FunctionComponent<EuiDraggableProps> = ({
{...provided.draggableProps}
{...(!customDragHandle ? provided.dragHandleProps : {})}
ref={provided.innerRef}
data-test-subj="draggable"
data-test-subj={dataTestSubj}
className={classes}
style={{ ...style, ...provided.draggableProps.style }}>
{cloneElement(DraggableElement, {
Expand Down
3 changes: 2 additions & 1 deletion src/components/drag_and_drop/droppable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const EuiDroppable: FunctionComponent<EuiDroppableProps> = ({
type = 'EUI_DEFAULT',
withPanel = false,
grow = false,
'data-test-subj': dataTestSubj = 'droppable',
...rest
}) => {
const { isDraggingType } = useContext(EuiDragDropContextContext);
Expand Down Expand Up @@ -96,7 +97,7 @@ export const EuiDroppable: FunctionComponent<EuiDroppableProps> = ({
{...provided.droppableProps}
ref={provided.innerRef}
style={style}
data-test-subj="droppable"
data-test-subj={dataTestSubj}
className={classes}>
<EuiDroppableContext.Provider
value={{
Expand Down