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

[BREAKING CHANGE][Feature] Button: убираем автоматическое превращение в квадратную #2795

Open
2 tasks
eugpoloz opened this issue Jul 4, 2022 · 1 comment

Comments

@eugpoloz
Copy link
Contributor

eugpoloz commented Jul 4, 2022

Проблема:

Сейчас в компоненте Button мы проверяем before и after на наличие иконок и подбиваем паддинги и высоту, если в кнопке только одна иконка. Здесь есть несколько подводных камней:

  • мы как мейнтейнеры подразумеваем, что в before и after передаются только иконки, хотя наверняка мы не можем этого знать,
  • часть пользователей либы библиотеки иконку в children и ожидает, что паддинги и высота подстроятся. При этом мы опять же никак не можем знать, что именно пользователь передал в кнопку. Пример кейса, где попытка проверить, что же там закинули в children, обернется провалом, есть в fix(Button): icon in children #2756

Решение: разделить сущности. Если нужна обычная кнопка — предлагаем использовать Button, если квадратная для иконки — IconButton.

  • убираем отвечающую за подбивку паддингов и высоту логику в v5 (внутренние свойства hasIcons и hasIconOnly),
  • за квадратными кнопками перенаправляем в IconButton.
@eugpoloz eugpoloz added this to the v5 milestone Jul 4, 2022
@SevereCloud SevereCloud moved this to To do in VKUI Aug 1, 2022
@SevereCloud SevereCloud added this to VKUI Aug 1, 2022
@stoope stoope modified the milestones: v5, v6 Aug 23, 2022
@inomdzhon inomdzhon moved this from 🔜 To do to 🗃 Backlog in VKUI Sep 5, 2023
@inomdzhon inomdzhon removed this from the v6 milestone Nov 27, 2023
@inomdzhon inomdzhon moved this from 🗃 Backlog to ⛔️ Blocked in VKUI Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ⛔️ Blocked
Development

No branches or pull requests

3 participants