Skip to content

Conversation

@foxbunny
Copy link
Collaborator

  • Improves positioning in tricky layouts in exchange for a performance hit
  • Adds a placeholder selector for adding positioning properties to the target element

@foxbunny
Copy link
Collaborator Author

This is an extracted and improved (in terms of code style) version of the updated positioning logic in the dual date picker PR. I need this for another PR I'm working on.

- Improves positioning in tricky layouts in exchange for a performance
  hit
- Adds a placeholder selector for adding positioning properties to the
  target element
window.addEventListener(
'resize',
() => {
strategy.resetGeometry(adjustPosition);
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be debounced? Running an event handler on resize cause a pretty high amount of events if you actually resize the window (and not just move e.g. between normal and maximized).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Technically it would need to be throttled, not debounced. But it's probably optimizing for an edge case to degrade the experience for the primary case where you are dealing with one-time screen rotate, maximize-minimize type of events.

@ThiefMaster ThiefMaster added this to the v3.3 milestone Oct 28, 2024
@ThiefMaster ThiefMaster merged commit 0c5eada into indico:master Oct 29, 2024
@ThiefMaster
Copy link
Member

There's a small regression which I think comes from this PR:

image

When the Dropdown moves upwards instead of downwards, the upper border is hidden - which makes sense when opening downwards, but looks weird when when opening upwards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants