misskey icon indicating copy to clipboard operation
misskey copied to clipboard

In a window, when its size is between whether or not the scrollbar is visible, the style's width determination loops endlessly and the display is too violent.

Open tamaina opened this issue 3 years ago • 13 comments

💡 Summary

ウィンドウで、そのサイズがスクロールバーが表示されるかどうかの間になっているとき、スタイルの幅の判定が無限ループして表示が荒ぶる

https://user-images.githubusercontent.com/7973572/187453682-d89dca39-c066-43da-a420-23717daf6864.mp4

🥰 Expected Behavior

表示が固定される

🤬 Actual Behavior

表示が荒ぶる

📌 Environment

Misskey version: Misskey v12.118.1 Your OS: Windows 11 Your browser: Microsoft Edge バージョン 104.0.1293.70 (公式ビルド) (64 ビット)

tamaina avatar Aug 30 '22 13:08 tamaina

サイズ判定の際にスクロールバーの幅を足せば解決

syuilo avatar Aug 30 '22 14:08 syuilo

これいい加減解決しなきゃな

tamaina avatar Nov 26 '22 09:11 tamaina

一番めんどくさいくないのはoverflow-y: scrollにしてスクロールバーを常に表示させること

tamaina avatar Nov 26 '22 10:11 tamaina

サイズ判定の際に

うーん、普通のflexboxでも荒ぶったりするんでなぁ

tamaina avatar Nov 26 '22 10:11 tamaina

https://user-images.githubusercontent.com/7973572/204084415-c2854f31-ba4f-4bec-b3ae-d7eb42d332ee.mov

と思ったけどこれflexboxが原因じゃない?

どこでどういうサイズ判定が働いているのかわかってない

tamaina avatar Nov 26 '22 10:11 tamaina

https://github.com/misskey-dev/misskey/blob/8b9dc962ae7b04354c65f6e80ad0e9a6bafd57ea/packages/client/src/components/global/MkSpacer.vue#L2

ここら辺かな

tamaina avatar Nov 26 '22 10:11 tamaina

paddingの指定

tamaina avatar Nov 26 '22 10:11 tamaina

clientWidthにすればいいかな?

tamaina avatar Nov 26 '22 10:11 tamaina

I noticed a similar issue when sending chat messages sometimes on desktop, however, I wasn't able to figure out the reproduction steps.

But it seemed to happen when the chat composer box was above the bottom of the screen. If I scrolled up, it would resolve it.

I don't know if it's related to this, but I thought I'd mention it in case.

Trif4 avatar Nov 26 '22 10:11 Trif4

再現性については、あるサイズにウィンドウを狭めると必ず発生します

clientWidthにすればいいかな?

逆では(offsetWidthの方がスクロールバーを含んでいる)

tamaina avatar Nov 26 '22 11:11 tamaina

ResizeObserverの反復実行にリミットをつけた方が良さそうだな

tamaina avatar Nov 26 '22 11:11 tamaina

https://github.com/misskey-dev/misskey/blob/8b9dc962ae7b04354c65f6e80ad0e9a6bafd57ea/packages/client/src/components/global/MkSpacer.vue#L44

これ本当?

acid-chicken avatar Nov 26 '22 11:11 acid-chicken

これ本当?

Safari 15.4から対応なので妥当なコメント

https://caniuse.com/mdn-api_resizeobserverentry_borderboxsize

image

tamaina avatar Nov 26 '22 11:11 tamaina