Skip to content

Improve resize on tooltip content change - use appropriate corner to pin tooltip, depending on gravity #31

Closed
@puzrin

Description

@puzrin

This issue is followup to #27.

Pinning point should be selected, depending on popover location. Then, if content grows, popover will change in proper direction without additional position recalulation.

1. Use-case for corners:

example

We load content in 2 stages:

  • show dummy popup with "loading" progress
  • substitute content

If popup grows on second step, then it overlap link (now). So, now we have to call recacculation, to move it up. But if you pin popup with bottom left corner, then it will automatically extend in proper direction (up and right).

IMHO, in practice, it would be very convenient to select "proper" pinned corner for each gravity option. Then it will change inproper direction without additional JS call.

2. Comments about side-placed (left-right-top-bottom) popups:

For side-placed tooltip there are no unique pinning solution. But it's limited to 2 possible choices, instead of 4. I don't have strong opinion, how to choose the best corner of 2.

IMHO, rigth now you can select any of 2, and if someone will have the real case in practice, then you could improve it. IMHO, if someone have top or bottom placed popup, he will fix width. Then content change will only affect height - no problem.

Metadata

Metadata

Assignees

Labels

FeatureSoftware improvements that involve implementing new features.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions