palantir/blueprint

Some mechanism for letting EditableText shrink to its content size when not editing

开放

#4,543 创建于 2021年2月25日

 (0 条评论) (0 个反应) (0 位负责人)TypeScript (2,167 个派生)batch import
P2Package: coreType: enhancementhelp wanted

仓库指标

星标
 (20,263 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

So this mostly already happens, but the min-width on the inner span is set to 80px. Have a UI like this:

Without doing some css hacking to unset the min-width, it ends up looking like this:

css hacking I'm doing is:

.display-name-value {
    max-width: 250px;

    > :last-child {
        // Need our EditableTexts to contract to their content size
        /* stylelint-disable declaration-no-important */
        min-width: unset !important;
        /* stylelint-enable declaration-no-important */
    }
}

but that's obviously really flaky, so was hoping for a more formal way to remove/lower the min-width (unset isn't necessarily correct because you get into a weird spot if you don't have a placeholder, but want the ability to make it lower than 80px at least)

贡献者指南