Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Max Width of Tab Button

    Chrome 85.0.4183.83 (Official Build) (64-bit)

    Client-side only: v12.0p_2020-02-02/LGPL Deployment

    I am looking for a way to set a max-width on a TabSet tab button/title. By default, the width of the tab button will expand based on the title length. I want it to do this, but only to a certain width... i.e. something along the lines of a maxTabWidth property or something similar.

    I have tried several things, including the following:

    - setting maxWidth on button properties, within tabBar properties:
    Code:
    TabSet.tabBarProperties: { buttonProperties: { maxWidth: 100 } }
    - setting maxWidth and overflow on the same set of properties:
    Code:
    TabSet.tabBarProperties: { buttonProperties: { maxWidth: 100, overflow: "hidden" } }
    - setting width on tab after initialization/adding of the tab:
    Code:
    this.setTabProperties(tab, { width: 100 });
    - setting width on tab at initialization/adding of the tab with the tab properties:
    Code:
    this.addTab({ width: 100 });
    - setting width and/or maxWidth on tab at initialization/adding of the tab with the tab properties:
    Code:
    this.addTab({ width: 100, maxWidth: 100 });
    and I think some other things as well but at this point I am perplexed how to figure this one out. Is there anything that I can do to achieve this? Thanks in advance.

    #2
    The problem with clipping on a per-tab basis is that you could end up with just a couple of tabs with long titles on a wide screen, where no clipping is necessary, but it would still occur. So instead, we don't clip per tab, and we offer automatic scrolling and a tab picker (basically a drop-down menu of tabs).

    We have a Feature Sponsorship program where you can fund enhancements for low fees, but, we wouldn't want to add per-tab max widths as we see it as not as good. What could make sense would be to begin clipping if all tabs don't fit, up to a maximum amount of clipping across all clipped tabs, then start scrolling, and that would be a valid sponsorship.

    If you're really really committed to clipping titles on a per-tab basis, you could do offscreen measurement of the tab title, and clip the title with an ellipsis if it's too big.

    Comment

    Working...
    X