Tabs width set on width of contents - truncating tabs
See original GitHub issueALL 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
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (19 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.