Umbraco-cms: umboverlay.directive isn't context aware

Created on 31 Jul 2019  路  16Comments  路  Source: umbraco/Umbraco-CMS

The umboverlay.directive directive isn't context aware. The location is always based on the $("#contentwrapper");

  1. copy a nested content value using the new copy functionality
  2. Open a small editor overlay where also a nested content is in (no infinite overlay)
  3. Click the left side of the 'add content' button of nested content (clicking right side will base the overlay on the right side of the screen -> no problem then....)
  4. the 'left' and 'top' position of the 'paste or new' overlay will be relative to the small editor overlay and be place off-screen.

It should be based on the context you are in

But seem to be here: https://github.com/umbraco/Umbraco-CMS/blob/040ebfe9dd7d7053ccf4393f8a83c11fc3866b69/src/Umbraco.Web.UI.Client/src/common/directives/components/overlays/umboverlay.directive.js#L383

The bug is created by using the position of $("#contentwrapper") instead of the editor itself (mabye use the element clicked to set the position?)

typbug

All 16 comments

image

Haven't tested completely, but maybe container can be retrieved from el like

            var container = el[0].closest(".umb-editor");
            var containerLeft = container.offsetLeft;
            var containerRight = containerLeft + container.offsetWidth;
            var containerTop = container.offsetTop;
            var containerBottom = containerTop + container.offsetHeight;

This uses the closest .umb-editor as the container instead of #contentwrapper

Thanks @skttl I can make pull request for this, but maybe HQ (@nul800sebastiaan ) has an idea to fix this in another way?

Ah, it's position:fixed, so using the closes .umb-editor won't do...

The real problem is about css positioning, this is where it's placed in the default infinite editor dialog. Note the cursor, showing where I clicked.

billede

Correct behaviour would be to have the overlay centered around the click position, like here:
billede

This is the same issue as described here, correct?

https://github.com/umbraco/Umbraco-CMS/issues/6011

It should be fixed somehow by making sure we know from which element in the DOM we're opening the dialog and positioning it relative to that it seems like, not relative to the mouse cursor though, it needs to be consistent so it opens on the middle of the element you clicked.

@nul800sebastiaan that seems a duplicate indeed.

Do you want to have me/community a go at this or do HQ want to take a look at this since it might impact more then we see now?

I don't think it should impact more, but it's a bit hard to tell without experimenting. I am very happy for someone in community looking at it for now if anyone has the time! 馃憤

Hi @ArnoldV,

We're writing to let you know that we've added the Up For Grabs label to your issue. We feel that this issue is ideal to flag for a community member to work on it. Once flagged here, folk looking for issues to work on will know to look at yours. Of course, please feel free work on this yourself ;-). If there are any changes to this status, we'll be sure to let you know.

For more information about issues and states, have a look at this blog post

Thanks muchly, from your friendly PR team bot :-)

I hope this issue is resolved soon as it is also causing issues for the behaviour of the Doc Type Grid Editor extension. See this related issue for further information about that.

Running into this all the time when I use DTGE with a Nested Content editor inside it. When you copy a NC item and click the Add button, the dialog for choosing the copied item or a new item is positioned outside the viewport.

This sounds like the same issue described here: https://github.com/umbraco/Umbraco-CMS/issues/7754

Luckily this is fixed in 8.7 馃槃

That would be awesome! :-)

Aaah yes, I knew it sounded familiar. Fixed for 7.4.0 already 馃憤 I'll close this one as a duplicate of #7754, thanks!

Aaah yes, I knew it sounded familiar. Fixed for 7.4.0 already 馃憤 I'll close this one as a duplicate of #7754, thanks!

7.4.0? 馃槷

I'm getting senile.. I meant 8.7.0 馃槄 馃槀

Was this page helpful?
0 / 5 - 0 ratings