Column width adjustment issue with custom plugin columns
dstillman
Zotero Team
This discussion was created from comments split from: Problem with column width adjustment.
Upgrade Storage
- Uninstall BBT & restart Zotero
- Open Tools -> Developer -> Run Javascript
- Paste in
(The conversation can be found here but since this reproduces without BBT I don't think I need to be involved)Zotero.ItemTreeManager.refreshColumns()and click runBasically, every time `Zotero.ItemTreeManager.refreshColumns()` is called, a CSS rule is added to the stylesheet for each custom column, setting the `flex-basis` to some value. If `refreshColumns` is called again (when re-adding the custom column or having a different plugin that adds a custom column) then a second instance of this CSS rule is added that somehow conflicts with the first and sets a different `flex-basis` value which causes this buggy column resizing behaviour.
If you select the custom column header HTML element in the browser debug tools and disable all but the first CSS `flex-basis` rule - everything works again.
I created a workaround for my plugins here (https://github.com/Dominic-DallOsto/zotero-reading-list/blob/master/src/utils/itemTreeStyleSheetBug.ts) that patches the stylesheet's `insertRule` function (that is called after `refreshColumns`) to ignore the adding of these conflicting CSS rules.
I guess a proper solution would require editing Zotero custom column API to not add these duplicate CSS rules.
Zotero 8.0-beta.25+145fbfa19 (64-bit)
Windows 11
If it still happens without any plugins / custom columns added - then it's probably a different issue.
Thanks for the detailed report. I have no idea on the technical side, but it seems indeed to be the same problem. Glad to see the progress on it.
1. Activating scite-zotero-plugin
2. Adding a column of the plugin
3. Resizing the column will result in the same "glitchy" behavior, as it tries to expand the bar, especially if the column name is long