Page MenuHomePhabricator

[PostEdit] Expand the onclick region of the close button
Closed, ResolvedPublic

Description

Author: mr.heat

Description:
Current onclick region in red, favored in blue

I'm reposting the comment https://bugzilla.wikimedia.org/show_bug.cgi?id=40307#c8 as a separate bug.

It's nice to have the close button (the little "x") on the popup. This way everybody can see it's possible to make the popup go away without trying to click it.

But: The onclick region is way to small (red rectangle in the attached screenshot). The popup goes away very fast and it's almost impossible to hit the small "x" in that short time. The region should be much, much bigger. At least the blue rectangle. Even with such a big onclick region nothing is obfuscated. Clicking the close button by accident is not possible. It's still possible to select the text (if you are fast enough to do this).


Version: unspecified
Severity: enhancement

Attached:

Details

Reference
bz41323

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 1:10 AM
bzimport set Reference to bz41323.
bzimport created this task.Oct 23 2012, 8:39 PM
ori added a comment.Oct 23 2012, 9:04 PM

Good idea; implemented. Gerrit change 29694.

mr.heat wrote:

With the following code the "x" is positioned exactly as it is now.

.postedit-close {

line-height: 2.3em;
padding: 0 .8em;
right: 0;
top: 0;

}

The right position was 0.8em. I moved this to the padding.

The top position was 0.6em. I added this to the line-height (0.6em + 1.1em + 0.6em = 2.3em).

Slightly related: I saw that the resulting HTML code looks like <div class="postedit-icon">this with the text inside the icon container</div>. I don't think this is intended. The CSS contains a "line-height: 25px" for that container which does make for the icon but not for the text. Everything else uses "em". This makes the calculated height of the popup 0.6em (padding) + 25px (line-height for a single line of text) + 0.6em (padding). Because of this mix of "px" and "em" it's not really possible to center the "x".

You should use "em" everywhere except for the (empty) icon container.

ori added a comment.Jan 22 2013, 2:42 AM

LGTM. Thanks, TMg.
Patch in Gerrit: https://gerrit.wikimedia.org/r/#/c/45085/