ExtJS 按鈕的 `tooltip` (QuickTip) 出現:
專案自定義 CSS 覆蓋了 ExtJS 原生樣式類。常見衝突類名:
.x-tip, .x-tip-body, .x-tip-header.x-btn, .x-btn-inner* { box-sizing: border-box; } 或 body { font-size: ... } 影響佈局計算。
/* 在專案 CSS 最後引入,或使用 !important 覆蓋 */
.x-tip {
background-color: #ffffe0 !important; /* 恢復預設淡黃 */
border: 1px solid #cccccc !important;
}
.x-tip-body {
color: #333 !important;
padding: 4px 8px !important;
}
/* 將專案樣式包裹在特定類下,避免污染 ExtJS 元件 */
.my-app .custom-btn { ... } /* 不要裸寫 .x-btn { ... } */
HTML 結構:
// sass/var/all.scss
$tooltip-background-color: #ffffe0;
$tooltip-border-color: #cccccc;
$tooltip-body-padding: 4px 8px;
重新編譯主題 (`sencha app build`) 生效。
通常由 position: relative/absolute 衝突或 z-index 錯亂導致。
/* 強制 tooltip 定位邏輯優先 */
.x-tip {
position: absolute !important; /* ExtJS 內部用 absolute 定位 */
z-index: 10000 !important; // 確保浮層最高
}
ext-all.css → theme-xxx.css → custom.css。Ext.tip.QuickTipManager.init() 統一配置 tooltip 行為。