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

[Modal] убрать отображение фокуса на крестике при клике мышью #2565

Merged
merged 4 commits into from
Oct 27, 2021

Conversation

HelenaIsh
Copy link
Contributor

@HelenaIsh HelenaIsh commented Oct 19, 2021

fix #2549
Реализовала через keyListener, как в остальных контролах.

@HelenaIsh HelenaIsh marked this pull request as draft October 19, 2021 08:18
@HelenaIsh HelenaIsh marked this pull request as ready for review October 20, 2021 04:43
@HelenaIsh HelenaIsh requested a review from lossir October 20, 2021 04:43
Comment on lines -101 to -103
&:focus {
outline: 2px solid ${t.borderColorFocus};
}
Copy link
Member

Choose a reason for hiding this comment

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

Чуть выше надо ещё удалить селектор &:focus,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

селектор удалила, но в класс focus из него перенесла свойство color, тк при фокусе цвет должен меняться

const [focusedByTab, setFocusedByTab] = React.useState(false);

const handleFocus = () => {
if (!disableClose) {
Copy link
Member

Choose a reason for hiding this comment

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

Сейчас кнопка внешне не меняется, по факту попадает в фокус. Это уже другая ошибка, т.к. подобное поведение есть и сейчас, но давай поправим =)
Надо вместо этого условия добавить проп tabIndex={disableClose ? -1 : 0} в саму кнопку. Тогда она даже не будет попадать в фокус, соответственно не будет дергать событие onFocus.

@HelenaIsh HelenaIsh marked this pull request as draft October 20, 2021 10:49
@HelenaIsh HelenaIsh marked this pull request as ready for review October 21, 2021 04:46
@HelenaIsh HelenaIsh requested a review from lossir October 21, 2021 04:46
@zhzz zhzz merged commit b589014 into master Oct 27, 2021
@zhzz zhzz deleted the fix-2549 branch October 27, 2021 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[Modal] рамка фокуса на крестике видна при клике
3 participants