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(core/tooltip): cutoff near viewport edges #1462

Merged
merged 7 commits into from
Sep 11, 2024
Merged

Conversation

matthiashader
Copy link
Collaborator

@matthiashader matthiashader commented Sep 6, 2024

💡 What is the current behavior?

GitHub Issue Number: Closes #740, [IX-849], [IX.1206]

🆕 What is the new behavior?

  • Tooltip will automatically gets placed (if there isn't enough space)
  • Border radius gets inherited
  • updates floating-ui/dom to 1.6.10
  • resetted position internally before asigning new one.

Note

  • computePosition also return a top property, when 'fallbackAxisSideDirection' is set, this result in missplacement of the arrow -> will be reset
  • Potential source:
image
  • As the postion is set during computing and the middlewareData is deepmerged, this can result in the unwanted top property -> As postion = 'top' doesn't need the property, it has been removed (if its really necessary, this could also be checked)

🏁 Checklist

A pull request can only be merged if all of these conditions are met (where applicable):

  • 🦮 Accessibility (a11y) features were implemented
  • 🗺️ Internationalization (i18n) - no hard coded strings
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully
  • 📄 Documentation was reviewed/updated (pnpm run docs)
  • 🧪 Unit tests were added/updated and pass (pnpm test)
  • 📸 Visual regression tests were added/updated and pass (Guide)
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

Copy link

changeset-bot bot commented Sep 6, 2024

🦋 Changeset detected

Latest commit: 1e4020c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@siemens/ix Patch
@siemens/ix-angular Patch
@siemens/ix-react Patch
@siemens/ix-vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@matthiashader matthiashader marked this pull request as draft September 6, 2024 08:41
Copy link
Contributor

github-actions bot commented Sep 6, 2024

Report of strictNullChecks (strictPropertyInitialization) check

Typescript check

Total errors are the same in both branches

ESLint check

Total ESLint warnings are the same in both branches

@matthiashader matthiashader marked this pull request as ready for review September 9, 2024 06:24
@matthiashader matthiashader marked this pull request as draft September 9, 2024 13:11
Copy link
Collaborator

@danielleroux danielleroux left a comment

Choose a reason for hiding this comment

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

Fix cause a flicker effect using the steps: #1228

Screen Recording 2024-09-09 at 15 18 48

Here a runnable example code:

export class PlaygroundInternal {
  componentDidLoad() {
    const content = document.createElement('DIV');
    content.style.display = 'flex';
    content.style.marginTop = '600px';
    content.style.marginBottom = '600px';
    content.innerHTML = `
      <input checked id="checkbox_1_1" name="group_1" type="checkbox" />
      <label for="checkbox_1_1"> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</label>
      <div id="test" style="display: block; width: 5rem; height: 5rem; background: red">
      </div>
      <ix-tooltip style="align-self: flex-start;" for="#test">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
      </ix-tooltip>
    `;

    showModal({
      content: content,
    });
  }

  render() {
    return <Host></Host>;
  }
}

@matthiashader matthiashader marked this pull request as ready for review September 11, 2024 05:13
@danielleroux danielleroux merged commit 501cce5 into main Sep 11, 2024
16 checks passed
@danielleroux danielleroux deleted the fix/849-tooltip branch September 11, 2024 08:26
This was referenced Sep 11, 2024
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.

Tooltip visibility
2 participants