[英]GWT - DialogBox glass and GoogleChrome - glass doesn't repaint
我剛剛安裝了最新的谷歌瀏覽器,並試圖用 DialogBox 測試 GWT 2.3 代碼; 出於某種原因,像setGlassEnabled(true);
這樣的選項以一種奇怪的方式工作:(
如果 chrome 的滾動窗格(y position 為 0) ,則玻璃塗漆正確
但是,如果 chrome 的滾動窗格(y position > 0) ,則玻璃保持在 0 position,因此 chrome 的 rest 底部沒有被玻璃覆蓋:(
我要向我的構造函數展示第一個玻璃選項
...
public MyDIalog() {
this.setGlassEnabled(true);
this.setAnimationEnabled(true);
this.setModal(true);
this.setPreviewingAllNativeEvents(true);
...
我不太確定是什么導致了錯誤或其他原因,因為代碼在 IE 和 FF:S 中運行良好
所以我猜在 chrome 中,玻璃 position 總是 static 之類的,它的位置總是
x,y{0,0} w,h{firstInitedWidth,firstInitedHeight}
所以我的問題是 chrome 是否可以四處走走?
謝謝
解決了:
制作您自己的擴展 PopupPanel 的 class 並添加:
@Override
public void setGlassEnabled(boolean enabled) {
super.setGlassEnabled(enabled);
Element glass = getGlassElement();
if (glass != null) {
glass.getStyle().setPosition(Position.FIXED);
}
}
這只是將玻璃面板的 position 設置為固定而不是絕對。 這使得面板不會隨着滾動而移動。
奇怪....但我想最壞的情況是你可以在 css 中給玻璃樣式一些瘋狂的高度/寬度。
.gwt-PopupPanelGlass{
height:15000 px;
width:15000 px;
}
作為替代方案,無需設置寬度和高度,您始終可以將 CSS 屬性設置為固定(使用 !important 指令)
.gwt-PopupPanelGlass {
position:fixed!important;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.