Dash 工具提示未与指定目标对齐

问题描述 投票:0回答:0

我遇到了 dbc 工具提示未与目标项目正确对齐的问题。请参阅下面的示例代码和图像,但是我发现如果我在同一个 dbc.Row 中有更多工具提示,所有工具提示都会在同一位置(最左侧)弹出。我真的无法解释这种行为,因为大多数时候弹出的工具提示都离目标项目很远。定期这似乎间歇性地工作,然后回到最左边弹出..

我尝试使用按钮而不是图标,但看到了相同的行为。这是一个错误还是我在这里做错了什么?

我使用以下软件包运行 python 3.9.13:

dash==2.6.0
dash-bootstrap-components==1.2.0
dash-bootstrap-templates==1.0.8
dash-core-components==2.0.0
dash-html-components==2.0.0
dash-table==5.0.0
dash-table-experiments==0.6.0

这里是重现我所看到的问题的示例代码:

import dash
import dash_bootstrap_components as dbc
from dash import html

app = dash.Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP, dbc.icons.BOOTSTRAP])

#p2_icon = html.I(className="fa fa-info-circle fa-1x", id="info-icon")
p2_icon = html.I(className="bi bi-info-circle me-2", id="info-icon")
p2_info_tooltip = dbc.Tooltip("Tool tip", target="info-icon")

app.layout = html.Div([
    html.H1("My Dash App"),
    dbc.Row([
       dbc.Col([], width="1"),
        dbc.Col([],width="1"),
        dbc.Col([
            p2_icon,
            p2_info_tooltip,
        ]),
    ]),
])

if __name__ == '__main__':
    app.run_server(debug=True)

css python-3.x tooltip plotly-dash dashboard
© www.soinside.com 2019 - 2024. All rights reserved.