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

overflow-menu : Oververflow-menu-body position is wrong #9827

Closed
2 tasks done
rccc opened this issue Dec 15, 2022 · 8 comments · Fixed by #11448
Closed
2 tasks done

overflow-menu : Oververflow-menu-body position is wrong #9827

rccc opened this issue Dec 15, 2022 · 8 comments · Fixed by #11448
Assignees
Labels
bug Something isn't working dev Needs some dev work package: carbon web components

Comments

@rccc
Copy link

rccc commented Dec 15, 2022

Description

overflow-menu-body should be inside oveflow-menu, but once oveflow-menu is open, i noticed overflow-menu-body is outside and then position on screen is wrong.

Component(s) impacted

overflow-menu

Capture d’écran du 2022-12-15 14-54-27

Browser

Chrome, Firefox

Carbon for IBM.com version

1.21.0

Severity

Severity 1 = The design is broken in a critical way that blocks users from completing tasks or damages the brand. Affects major functionality, no workaround.

Application/website

https://codesandbox.io/s/github/carbon-design-system/carbon-web-components/tree/main/examples/codesandbox/basic/components/pagination

Package

@carbon/ibmdotcom-web-components

CodeSandbox example

https://codesandbox.io/s/github/carbon-design-system/carbon-web-components/tree/main/examples/codesandbox/basic/components/pagination

Steps to reproduce the issue (if applicable)

No response

Release date (if applicable)

No response

Code of Conduct

@rccc rccc added bug Something isn't working dev Needs some dev work labels Dec 15, 2022
@stale
Copy link

stale bot commented May 27, 2023

We've marked this issue as stale because there hasn't been any activity for 60 days. If there's no further activity on this issue in the next three days then we'll close it. You can keep the conversation going with just a short comment. Thanks for your contributions.

@techtolentino
Copy link

Same thing happens for us, when trying to use it...

Screenshot 2023-06-02 at 1 32 51 PM

@stale stale bot removed the inactive label Jun 2, 2023
@kennylam kennylam moved this to Backlog in Carbon for IBM.com Jun 5, 2023
@kennylam kennylam added the severity 2 Affects major functionality, has a workaround label Jun 5, 2023
@kennylam
Copy link
Member

kennylam commented Jun 5, 2023

@rccc @techtolentino Can you share repros?

@rccc
Copy link
Author

rccc commented Jun 5, 2023

@kennylam

I am going to check what i can share. Let me a few days.

Eric

@techtolentino
Copy link

@rccc - thanks for responding. Don't worry about it. I figured out ☝🏼 this issue, but then ran into other issues within our own application that makes this particular component unusable (for our use case).

Thanks!

@kennylam kennylam added package: carbon web components and removed severity 2 Affects major functionality, has a workaround labels Dec 19, 2023
@dave-wood
Copy link

Hi - as discussed with @ariellalgilmore I'm seeing a weird bug when using an overflow menu within a data-table to do filtering on the table. See this example:
https://codesandbox.io/p/devbox/stoic-wescoff-k4wlrm?file=%2Fsrc%2Findex.js%3A18%2C1

If I reload the preview panel, scroll down with the scroll bar until Example table is in the middle of the screen, then click the filter icon (next to the Search icon) in the Example Table, it opens an overflow menu, but jumps the page to the top.

Interestingly, I've discovered whilst using codesandbox, that it only started jumping to the top once I added the pagination for the table at the bottom! Specifically, when I added the select/index.js component to make the page number drop down work. So even though the affected table doesn't have pagination, the presence of pagination on a different table causes the problem.

@aaronmg241
Copy link

Any fixes for this? The component has the described behaviour no matter its location (within a table, direct descendant of body tag, etc). I was able to reproduce in:
https://codesandbox.io/p/sandbox/naughty-curran-rx95n3?file=%2Findex.html as well.

The only fix I have right now is to use a workaround where we manually set the top attribute using a MutationObserver whenever the top attribute is attempted to be changed. This is obviously unsustainable, but the component is otherwise unusable.

@kennylam
Copy link
Member

It's been added to this sprint, so it should be included in the next release.

@ariellalgilmore ariellalgilmore self-assigned this Jan 24, 2024
@ariellalgilmore ariellalgilmore moved this from Backlog to Review in Carbon for IBM.com Jan 24, 2024
@kodiakhq kodiakhq bot closed this as completed in #11448 Jan 31, 2024
kodiakhq bot pushed a commit that referenced this issue Jan 31, 2024
### Related Ticket(s)

Closes #9827 

### Description

the `refBottom` needs to be compared to the `containerTop`, so that the menu sticks to the bottom of button

Example (using local `yarn pack`:
https://codesandbox.io/p/devbox/test-overflowmenu-t4slfp?file=%2F.codesandbox%2Ftasks.json%3A1%2C241
live demo: https://t4slfp-9000.csb.app/
### Changelog

**New**

- {{new thing}}

**Changed**

- changed `refBottom` to a let and then equal `refBottom = refBottom - containerTop;`
- ^ wondering if this can be cleaned up code wise, but testing locally with overflow-menu it seems successful

**Removed**

- {{removed thing}}

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
@github-project-automation github-project-automation bot moved this from Review to Done in Carbon for IBM.com Jan 31, 2024
m4olivei pushed a commit to m4olivei/carbon-for-ibm-dotcom that referenced this issue Feb 1, 2024
### Related Ticket(s)

Closes carbon-design-system#9827 

### Description

the `refBottom` needs to be compared to the `containerTop`, so that the menu sticks to the bottom of button

Example (using local `yarn pack`:
https://codesandbox.io/p/devbox/test-overflowmenu-t4slfp?file=%2F.codesandbox%2Ftasks.json%3A1%2C241
live demo: https://t4slfp-9000.csb.app/
### Changelog

**New**

- {{new thing}}

**Changed**

- changed `refBottom` to a let and then equal `refBottom = refBottom - containerTop;`
- ^ wondering if this can be cleaned up code wise, but testing locally with overflow-menu it seems successful

**Removed**

- {{removed thing}}

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
kennylam pushed a commit to kennylam/carbon-for-ibm-dotcom that referenced this issue Jun 11, 2024
### Related Ticket(s)

Closes carbon-design-system#9827 

### Description

the `refBottom` needs to be compared to the `containerTop`, so that the menu sticks to the bottom of button

Example (using local `yarn pack`:
https://codesandbox.io/p/devbox/test-overflowmenu-t4slfp?file=%2F.codesandbox%2Ftasks.json%3A1%2C241
live demo: https://t4slfp-9000.csb.app/
### Changelog

**New**

- {{new thing}}

**Changed**

- changed `refBottom` to a let and then equal `refBottom = refBottom - containerTop;`
- ^ wondering if this can be cleaned up code wise, but testing locally with overflow-menu it seems successful

**Removed**

- {{removed thing}}

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "test: e2e": Codesandbox examples and e2e integration tests -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev Needs some dev work package: carbon web components
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.