GraphiteEditor / GraphiteEditor/Graphite

Improve FloatingMenu CSS so it stays with its parent scroll

オープン
#634 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
Web
主要言語
Rust
スター
27.2k
フォーク
1.3k
平均マージ
20時間 5分
マージ済み PR(30日)
57

説明

Before 8bc85bd774ff3349bbdc5eb652643bf69fee83e4, the CSS was set up to make floating menus employ a clever but fragile arrangement of `position: flex`, `position: absolute`, `transform: translate(0)`, and other properties to make the elements stick to the bottom of their parent (without needing JS to position them) and also not get clipped by the `overflow: hidden` of their containing panel.

It was discovered that this arrangement did not hold up to the problem of scrolling the parent, such as the Properties panel containing widgets that spawn a floating menu (like ColorInput). 8bc85bd774ff3349bbdc5eb652643bf69fee83e4 used JS to fix this, but doing so has the drawback that it isn't recomputed automatically by the CSS engine when things change. Window resizes, scrolling the parent, and other changes can cause the position of the spawner to change but the JS won't update the floating menu.

When placing floating menus within other floating menus (specifically, a DropdownInput inside a DialogModal in #629), it became necessary to further complicate the JS logic by disabling the positioning behavior. But if a DialogModal ever has scrollable content in the future, disabling it won't fix the original scrolling problem.

If possible, investigate a primarily CSS-based solution that's robust to the challenges described above. Then revert the complex JS that was introduced in that commit. This might help: https://css-tricks.com/popping-hidden-overflow/

Additionally, Safari behaves differently and currently clips the floating menu within a scrollable panel (but not non-scrollable ones, it seems... or at least it does for the Properties panel but not the Document panel). And in Safari, our distance-to-edge measuring code also seems to calculate the edges wrong since the primary/secondary color picker swatch goes too low and cuts it off the bottom of the app. So another solution is needed for the problem as a whole, but it also needs to account for fixing these issues on Safari.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Review commit 8bc85bd774ff3349bbdc5eb652643bf69fee83e and the FloatingMenu positioning logic, including its interactions with Properties panels, ColorInput, DropdownInput, and DialogModal. Investigate a primarily CSS-based approach that remains correct during parent scrolling and resizing, avoids clipping, and works in Safari; done means the complex positioning JS can be reverted without reintroducing these issues.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
css, javascript
領域
frontend
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。