-
-
Notifications
You must be signed in to change notification settings - Fork 827
Increase touch area of close button in settings dialog #10145
Increase touch area of close button in settings dialog #10145
Conversation
Resolved bug by increasing touch area of close button in settings dialog
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.
We're adding a wrapper HTML element for purely stylistic reasons, and that is CSS roles.
I believe we should remove the wrapper and virtually increase the touch zone using a pseudo element
button::after {
position: absolute;
inset: -10px;
content: "";
}
Something of the sort will probably do the trick, but I have not tested that locally.
Hello @gsouquet, Thanks for suggestion, I will check on it. |
Hey @gsouquet, I added to css what code you suggested but touch area is not working as expected, can you check from your side once. Mainly i see CSS and HTML code for that close button is not structured well then i changed it. You can check demo in local of my PR you will definitely see increased touch area and aligned CSS along with HTML in UI |
Hello, Anyone can help me out because @gsouquet, suggested some changes but when i tried, those are not working on UI, If anyone can guide me in some direction, so that i can improve my PR but existing PR you won't see any problems with it. But still if you need to improve let me know... |
Hey @gsouquet , Hope you are doing well, Can i expect any feedback. |
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.
I've put a very basic example showing how to increase the touch area around a button https://jsbin.com/xeqetazuqu/edit?html,css,output
I believe we should apply the same technic, rather than applying an extra HTML element as it carries zero semantic value
hey thanks for your reply, i am working on to match your solution because unlike other elements to add touch area, this element behaviour in different manner when applying css, i didn't stoped yet. Working on it, soon will raise with PR with updated code, Anything you want to update me, You can update... |
Hello @gsouquet, Updated the css code please look once for increase touch area for cancel button |
Hello @gsouquet, I updated based on your inputs, If you review then it will be great |
background-color: $dialog-close-fg-color; | ||
background-image: url("$(res)/img/cancel.svg"); | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
background-size: cover; | ||
cursor: pointer; | ||
position: unset; |
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.
I don't understand this change. Why is it needed, and I don't think the SVG will be tinted when changing the theme to dark or light.
Could you please revert this?
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.
Background color also won't tined with dark or light theme because It looks same for two themes, Manipulating the background color and using as cancel icon which is not recommend
Instead using Cancel button svg which is easily maintainable.
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.
This does not need to be changed, so i would request to either revert this as part of this pull request or doing it as described in https://github.com/matrix-org/matrix-react-sdk/blob/develop/docs/icons.md
res/css/_common.pcss
Outdated
width: 18px; | ||
height: 18px; | ||
position: absolute; | ||
top: 10px; | ||
right: 0; | ||
} | ||
|
||
.mx_Dialog_cancelButton::before{ |
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.
.mx_Dialog_cancelButton::before{ | |
.mx_Dialog_cancelButton::before { |
res/css/_common.pcss
Outdated
.mx_Dialog_cancelButton::before{ | ||
content: ""; | ||
position: absolute; | ||
height: 50px; |
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.
Ideally we should avoid hardcoding the height but use inset
or a combination of top
and bottom
so that the height is inferred from the parent element.
More future proof.
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.
background-color: $dialog-close-fg-color; | ||
background-image: url("$(res)/img/cancel.svg"); | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
background-size: cover; | ||
cursor: pointer; | ||
position: unset; |
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.
This does not need to be changed, so i would request to either revert this as part of this pull request or doing it as described in https://github.com/matrix-org/matrix-react-sdk/blob/develop/docs/icons.md
I'm going to close this as it hasn't had any activity. Feel free to re-open if you (or anyone) wants to keep it moving forward. |
Resolved bug by increasing touch area of close button in settings dialog
Checklist
Notes: Increased touch area and padding for close button under the settings dialog and maintaining well in terms of design and colour which suitable exactly for the settings dialog window.
Fixes element-hq/element-web#22915
Closes #9202
Type: [enhancement/defect/task]
Before -
After -

Fixes
Increased touch area and padding for close button under the settings dialog and maintaining well in terms of design and colour which suitable exactly for the settings dialog window. It fixes https Contributed by @BalanaguYashwanth
Here's what your changelog entry will look like:
🐛 Bug Fixes