palantir/blueprint

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

Open

#4,543 建立於 2021年2月25日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)TypeScript (20,263 star) (2,167 fork)batch import
P2Package: coreType: enhancementhelp wanted

描述

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)

貢獻者指南