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(select): virtual options list #497

Merged
merged 2 commits into from
Feb 10, 2023

Conversation

reme3d2y
Copy link
Contributor

@reme3d2y reme3d2y commented Feb 1, 2023

Пофиксил, но тут явно нужно рефакторить компонент

render(() => {
const optionsForVirtualList = React.useMemo(
        () =>
            new Array(1000).fill().map((_, index) => {
                const variableSizeText = `Вы восхитительны! `.repeat(
                    Math.round(Math.random() * 10),
                );

                return {
                    key: index,
                    content: `${index}. ${variableSizeText}`,
                };
            }),
        [],
    );

return <SelectMobile
        allowUnselect={true}
        options={optionsForVirtualList}
        placeholder='Список в модалке'
        block={true}
        multiple
    />
});
render(() => {
const optionsForVirtualList = React.useMemo(
        () =>
            new Array(1000).fill().map((_, index) => {
                const variableSizeText = `Вы восхитительны! `.repeat(
                    Math.round(Math.random() * 10),
                );

                return {
                    key: index,
                    content: `${index}. ${variableSizeText}`,
                };
            }),
        [],
    );

return <SelectModalMobile
        allowUnselect={true}
        options={optionsForVirtualList}
        placeholder='Список в модалке'
        block={true}
        multiple
    />
});

@changeset-bot
Copy link

changeset-bot bot commented Feb 1, 2023

🦋 Changeset detected

Latest commit: 1c757f0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@alfalab/core-components-bottom-sheet Minor
@alfalab/core-components-select Patch
@alfalab/core-components-tooltip Patch
@alfalab/core-components-input-autocomplete Patch
@alfalab/core-components-intl-phone-input Patch
@alfalab/core-components-picker-button Patch
@alfalab/core-components-select-with-tags Patch
@alfalab/core-components-table Patch
@alfalab/core-components-gallery Patch
@alfalab/core-components-tabs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coveralls
Copy link

coveralls commented Feb 1, 2023

Pull Request Test Coverage Report for Build 4132488210

  • 17 of 70 (24.29%) changed or added relevant lines in 4 files are covered.
  • 9 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.6%) to 79.918%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/select/src/components/base-select-mobile/virtual-options-list/Component.tsx 10 63 15.87%
Files with Coverage Reduction New Missed Lines %
packages/intl-phone-input/src/utils/preparePasteData.ts 2 68.66%
packages/tabs/src/hooks/use-collapsible-elements.ts 2 83.64%
packages/intl-phone-input/src/component.tsx 5 73.07%
Totals Coverage Status
Change from base Build 4122664931: -0.6%
Covered Lines: 7405
Relevant Lines: 8432

💛 - Coveralls

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds core-ds deleted a comment from core-ds-bot Feb 3, 2023

import styles from './index.module.css';

const VIRTUAL_OPTIONS_LIST_THRESHOLD = 30;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Пока так, потом лучше полноценно настроить

@SiebenSieben
Copy link
Contributor

Не забыть changeset)

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@reme3d2y reme3d2y force-pushed the fix/select-mobile-virtual-options-list branch from 1ed8227 to 6f44f4d Compare February 8, 2023 09:51
@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@core-ds-bot
Copy link
Collaborator

Собрана новая демка.

@reme3d2y reme3d2y merged commit 236118f into master Feb 10, 2023
@reme3d2y reme3d2y deleted the fix/select-mobile-virtual-options-list branch February 10, 2023 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants