vimb icon indicating copy to clipboard operation
vimb copied to clipboard

Wrong hint label positioning if element has negative margin

Open fanglingsu opened this issue 7 years ago • 3 comments

Steps to reproduce

Open http://git.exherbo.org/summer/ and start hinting by hitting f.

Expected behaviour

Hint label should be placed on the rupper left corner of the hinted element.

Actual behaviour

The hint labels are displaced towards top.

It seems that this is caused by negative margin set in the links.

a {
    padding: 10em;
    marign: -10em;
}

fanglingsu avatar Aug 03 '18 22:08 fanglingsu

I've added a manual test case for thie issue in tests/manual/hints/label-positioning.html. But it seems that the used element.getBoundingClientRect() is not our friend and we have to handle those cases by ourself.

fanglingsu avatar Aug 03 '18 22:08 fanglingsu

I'm not sure how to fix this issue. As I see the links there have really big bounding boxes. But by the higher dom elements the background of the links is only shown in the table cells. So if it would be possible to measure the visible part of the bounding box, we could use this to place the hint label.

fanglingsu avatar Aug 04 '18 21:08 fanglingsu

This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 03 '18 21:10 stale[bot]