Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixedOverflowWidgets=true makes suggestion widget shows at a wrong location when monaco-editor is hosted inside fluent Callout control #2503

Closed
weizhang-ms opened this issue May 26, 2021 · 10 comments
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@weizhang-ms
Copy link

weizhang-ms commented May 26, 2021

https://codesandbox.io/s/affectionate-satoshi-ywlnk?file=/src/App.js

The Monaco-editor is placed inside a fluent Callout control (https://developer.microsoft.com/en-us/fluentui#/controls/web/callout)

fixedOverflowWidgets=true - suggestion widget shows at a wrong location (left is correct, top is incorrect)

image

fixedOverflowWidgets=false - suggestion widget shows at the right position, but it doesn't show complete...

image

@weizhang-ms weizhang-ms changed the title fixedOverflowWidgets=true make suggestion widget shows at a wrong location when monaco-editor is hosted inside fluent Callout control fixedOverflowWidgets=true makes suggestion widget shows at a wrong location when monaco-editor is hosted inside fluent Callout control May 26, 2021
@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Aug 20, 2021
@moorain
Copy link

moorain commented Sep 2, 2021

I have the same problem. How can I solve it?

@weizhang-ms
Copy link
Author

weizhang-ms commented Sep 2, 2021

My workaround is to change the Callout style to overflow: 'visible', and set monaco-editor options fixedOverflowWidgets: false

        <Callout
          style={{ width: 400, padding: 16, height: 400, overflow: 'visible' }}
          gapSpace={0}
          target={`#buttonId`}
          setInitialFocus
        >
          <MonacoEditor
            height="100%"
            language="javascript"
            options={{ fixedOverflowWidgets: false }}
          />
        </Callout>

@dehoward
Copy link

dehoward commented Sep 3, 2021

We're noticing the same issue when using the fluent Panel.

sandbox

Notice that when the Editor is inside the Panel, the read-only widget appears in the wrong place:
image

But when outside, the widget is correctly placed:
image

@HappyEmu
Copy link

We have the same problem using fixedOverflowWidgets: true inside a Semantic UI React modal.

@dehoward
Copy link

dehoward commented Oct 13, 2021

@HappyEmu good to know, seems it's not Fluent related in that case.

@y6936
Copy link

y6936 commented Sep 29, 2022

After some investigation I found out that the animation on the callout/panel is causing the issue.
As a workaround you could set the animationName to 'none' on the Panel or Callout styles to get rid of the
animation which fixes the problem.

@silverwind
Copy link
Contributor

silverwind commented Mar 9, 2023

transform: translate(0px) on parent elements also triggers this bug.

Edit: Seems transform alone is not enough to reproduce, there must be something else as well.

@hediet
Copy link
Member

hediet commented Mar 13, 2023

Thanks for reporting this! I'm not sure, but this actually might be a duplicate.
In case it is not, please create an new issue and provide a reproducible example in the monaco editor playground. Thanks!

@hediet hediet closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2023
@silverwind
Copy link
Contributor

There are two reproducible examples in this issue. They could be more minimal but do showcase the issue.

@hediet
Copy link
Member

hediet commented Mar 13, 2023

Please reproduce in the monaco editor playground, because there we can control the monaco editor version, have debugging and can rule our bundling/framework issues.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

8 participants