首页 > 解决方案 > 滚动时 Blazor EditForm 会越过 MainLayout

问题描述

我有这个带有 MainLayout 顶部的 Blazor WASM,上面带有徽标和其他东西。在子表单上,我有一个 Editform,这项工作正常,但是当我滚动页面时,EditForm 滚动到 MainForm 的顶部而不是下方。其他内容在子滚动细下。有任何想法吗?亲切的问候

标签: scrollblazoralways-on-topwebassemblyblazor-editform

解决方案


When you say MainForm - do you mean the top bar on the screen? If so, go into your site.css and add z-index:9999; to your .main .top-row section. it should look similar to this:

.main {
    flex: 1;
}

.main .top-row {
    background-color: #f7f7f7;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
    **z-index: 9999;**
}

    .main .top-row > a, .main .top-row .btn-link {
        white-space: nowrap;
        margin-left: 1.5rem;
    }

.main .top-row a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

推荐阅读