-
Notifications
You must be signed in to change notification settings - Fork 63
fix(select): добавлен props, позволяющий управлять положением чекбокса [DS-8308] #1789
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
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 7f1db78 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
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 |
const OPTIONS = [
{ key: '1', content: 'Neptunium' },
{ key: '2', content: 'Plutonium' },
{ key: '3', content: 'Americium' },
{ key: '4', content: 'Curium' },
{ key: '5', content: 'Berkelium' },
{ key: '6', content: 'Californium' },
{ key: '7', content: 'Einsteinium' },
{ key: '8', content: 'Fermium' },
];
render(() => {
const [selectedFirst, setSelectedFirst] = React.useState([]);
return (
<div style={{ width: 320 }}>
<Select
allowUnselect={true}
size={56}
placeholder='Выберите элементы'
label='Множественный выбор'
Option={BaseOption}
multiple={true}
block={true}
optionProps={{
checkmarkPosition: 'before'
}}
{...useSelectWithApply({
options: OPTIONS,
checkmarkPosition: 'after',
showHeaderWithSelectAll: true,
selected: selectedFirst,
onChange: ({ selectedMultiple }) => {
setSelectedFirst(selectedMultiple.map((option) => option.key));
},
})}
/>
</div>
);
}); |
|
Собрана новая демка. |
Pull Request Test Coverage Report for Build 19614830628Details
💛 - Coveralls |
| })} | ||
| > | ||
| <Checkbox | ||
| className={cn({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
положение чекбокса скорее должно быть частью API Checkbox, а не исправляться здесь стилями.
и в самом Checkbox рисовать чекбокс условно, чтобы не полагаться на flex
checkmarkPosition === 'before' && <checkmark /> <content /> checkmarkPosition === 'after' && <checkmark /> There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
вынес доработку в #1958
ea9ba89 to
ef74cc9
Compare
4f0e5c9 to
2878cd4
Compare
b795bce to
32d6150
Compare
cd4fe30 to
9433e50
Compare
checkmarkPosition, позволяющий управлять положением чекбокса в "Выбрать всё"Чек лист
Если есть визуальные изменения
2025-07-24.00.17.57.mov