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

fix(ListItemView): some changes after feedback #1516

Merged
merged 1 commit into from
Apr 17, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ $block: '.#{variables.$ns}list-item-view';
flex-shrink: 0;

&__main-content {
width: 100%;
display: grid;
gap: var(--g-spacing-half, 2px);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';

import {Check, ChevronDown, ChevronUp} from '@gravity-ui/icons';

import {QA_DATA_ATTR} from '../../../../constants';
import {Icon} from '../../../Icon';
import {Text, colorText} from '../../../Text';
import {Flex, spacing} from '../../../layout';
Expand Down Expand Up @@ -89,7 +88,6 @@ const renderSafeIndentation = (indentation?: number) => {
export const ListItemView = React.forwardRef(
(
{
qa,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qa will be passed to element by chain Flex -> Box

id,
as = 'div',
size = 'm',
Expand Down Expand Up @@ -121,7 +119,7 @@ export const ListItemView = React.forwardRef(

return (
<Flex
{...{[LIST_ITEM_DATA_ATR]: id, [QA_DATA_ATTR]: qa}}
{...{[LIST_ITEM_DATA_ATR]: id}}
role={role}
aria-selected={selected}
onClick={onClick}
Expand All @@ -147,7 +145,7 @@ export const ListItemView = React.forwardRef(
justifyContent="space-between"
{...rest}
>
<Flex gap="2" alignItems="center">
<Flex gap="2" alignItems="center" grow>
{hasSelectionIcon && (
<ListItemViewSlot // reserve space
>
Expand Down
2 changes: 0 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ export const KeyCode = {
ARROW_UP: 'ArrowUp',
ARROW_DOWN: 'ArrowDown',
};

export const QA_DATA_ATTR = 'data-qa';
Loading