palantir/blueprint

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

Open

#4,543 opened on 2021年2月25日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)TypeScript (20,263 stars) (2,167 forks)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)

コントリビューターガイド