keepassxc-browser icon indicating copy to clipboard operation
keepassxc-browser copied to clipboard

Icons are visible on opacity:0 login; margin-top skewing icons

Open idontusenumbers opened this issue 5 years ago • 12 comments

Seems login forms within hidden windows (via opacity 0) still get positioned into and are visible.

Example at https://artinres.com/

Look a the middle of the page image

Additionally on this page theres a margin-top that's moving the position of the body element which screws the alignment of the keepass icons image

Debug info

KeePassXC-Browser Version: 1.6.2 KeePassXC Version: 2.5.3 Operating system: Mac Browser: Chrome

idontusenumbers avatar Apr 09 '20 22:04 idontusenumbers

I have noticed this as well

droidmonkey avatar Apr 10 '20 03:04 droidmonkey

@varjolintu Does this fix the margin-top induced issue as well?

idontusenumbers avatar Apr 11 '20 08:04 idontusenumbers

@idontusenumbers Oh, it doesn't. Let's reopen this and make another PR for that.

varjolintu avatar Apr 11 '20 08:04 varjolintu

https://github.com/keepassxreboot/keepassxc-browser/pull/840 - I'd suggest the fix is (maybe) made to this PR as it fixes the relative placement.

EDIT: getBoundingClientRect() should get the correct position. In this case it just doesn't handle the content that is added after checking the position.

varjolintu avatar Apr 11 '20 08:04 varjolintu

What an annoying problem. 1.7.0 still didn't fix it, but I'm making some slow progress. The problem is that I don't want to cause any extra slowdowns. At this point I can identify when the popup goes away, but it still gives a false positive for the input field visibility. So I need to somehow handle that + CSS animations.

varjolintu avatar Sep 02 '20 15:09 varjolintu

Instead of placing the keepassxc buttons at the root of the DOM, have you considered placing them as siblings of the text box they are being added to?

idontusenumbers avatar Sep 04 '20 02:09 idontusenumbers

@idontusenumbers Wouldn't that cause elements or the page content to be resized?

varjolintu avatar Sep 04 '20 04:09 varjolintu

Setting it to absolute position prevents it from affecting the layout.

It's not a flawless idea though, especially for highly manipulated inputs.

idontusenumbers avatar Sep 04 '20 04:09 idontusenumbers

@idontusenumbers It's already set to absolute position related to the input field. How would it differ from the current implementation to add the icon element as a sibling and still use position: absolute?

varjolintu avatar Sep 04 '20 05:09 varjolintu

If it were in the same parent, changes to position, opacity, display:none, or any other tricky manipulations that might effect the rendering on an ancestor would automatically apply to the keepassxc trigger too.

idontusenumbers avatar Sep 04 '20 05:09 idontusenumbers

@idontusenumbers If that's the case, I need to test if that works. Although I'm not in favor to modify any actual page elements. Now the content script elements are added at the end of the document body.

varjolintu avatar Sep 04 '20 05:09 varjolintu

@idontusenumbers while these issues are somewhat related, they are also clearly different. Please file a different ticket for each (I guess at this point only the second one since the primary one is solved IIUC).

Chealer avatar Jun 07 '24 18:06 Chealer