question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tabs width set on width of contents - truncating tabs

See original GitHub issue

ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)

Python version      :  3.6.8 |Anaconda, Inc.| (default, Dec 29 2018, 19:04:46) 
IPython version     :  7.1.1
Tornado version     :  5.1.1
Bokeh version       :  1.1.0dev8
BokehJS static path :  /Users/jsignell/conda/envs/panel-dev/lib/python3.6/site-packages/bokeh/server/static
node.js version     :  v7.10.0
npm version         :  4.2.0

Description of expected behavior and the observed behavior

The width of the tabs seems to be set based on the width of the item inside the tab without taking the width of the title into account. The result is a truncated tabs object where you can’t click on the second tab ( because it isn’t visible).

I originally raised this as https://github.com/pyviz/panel/issues/284

Complete, minimal, self-contained example code that reproduces the issue

from bokeh.models.widgets import Panel, Tabs, Button
from bokeh.io import output_notebook, show
from bokeh.plotting import figure

output_notebook()

tab1 = Panel(child=Button(label='+', width=30), title="This is a long title")
tab2 = Panel(child=Button(label='-', width=30), title="This is another long title")
tabs = Tabs(tabs=[ tab1, tab2 ])

show(tabs)

Screenshots or screencasts of the bug in action

screen shot 2019-03-07 at 9 20 29 am

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
philippjfrcommented, Jan 23, 2020

I think what you want is an equal_header_width option (would need to find a better name) on tabs that ensures that the tab headers are all the same width.

1reaction
jsignellcommented, Mar 7, 2019

The width needs to be large enough to see the title of every tab. If possible the titles should have a max_width set to 100%/n_tabs and they should wrap or overflow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to auto-resize tabs to fit a fixed-width container?
If you know how many 'tabs' you will have, then you can just divide 100 by that number, and set the width to...
Read more >
Standardize Size of Tabs, And Give Option for Truncated or Full
I'd like to be able to either select that all tab names should display fully, or have them truncated to a standard width,...
Read more >
TabPane (JavaFX 18)
The minimum width of a Tab in the TabPane . This can be used to limit the length of text in tabs to...
Read more >
Navs and tabs · Bootstrap v5.0
By default, navs are left-aligned, but you can easily change them to center or ... Force your .nav 's contents to extend the...
Read more >
Tabs - Material Design
Tabs organize content across different screens, data sets, and other ... Fixed tabs display all tabs on one screen, with each tab at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found