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

fix(listbox): detach toolbar on resize #1232

Merged
merged 2 commits into from Apr 24, 2023
Merged

Conversation

DanielS-Qlik
Copy link
Contributor

Motivation

Detach toolbar on resize.
fixes qlik-oss/sn-list-objects#244

Before:
Kapture 2023-04-20 at 16 22 39

After:
Kapture 2023-04-20 at 16 19 39

Requirements checklist

  • Api specification
    • Ran yarn spec
      • No changes OR API changes has been formally approved
  • Unit/Component test coverage
  • Correct PR title for the changes (fix, chore, feat)

When build and tests have passed:

  • Add code reviewers, for example @qlik-oss/nebula-core

const padding = 16;
const contentWidth = (titleRef?.current?.clientWidth ?? 0) + iconsWidth + padding;
const actionToolbarWidth = 128;
const notSufficientSpace = containerWidth < contentWidth + actionToolbarWidth;
const isTruncated = titleRef?.current?.scrollWidth > titleRef?.current?.offsetWidth;
const isDetached = !!(notSufficientSpace | isTruncated);
const isDetached = !!(notSufficientSpace || isTruncated);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@DanielS-Qlik DanielS-Qlik merged commit 4df9595 into master Apr 24, 2023
6 of 8 checks passed
@DanielS-Qlik DanielS-Qlik deleted the ild/resize-detach branch April 24, 2023 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Responsive toggling between attached and attached toolbar
2 participants