Last modified: 2011-12-15 13:13:38 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T32402, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 30402 - The header of collapsible elements is jumping left when expanded
The header of collapsible elements is jumping left when expanded
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
unspecified
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
https://secure.wikimedia.org/wikipedi...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-16 18:08 UTC by Helder
Modified: 2011-12-15 13:13 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Helder 2011-08-16 18:08:24 UTC
As reported on
[[Wikipedia:Village_pump_(technical)#Deprecation_of_Collapsible_tables_and_NavFrames]],
the header of collapsible elements is jumping left when expanded. This can be fixed by using a CSS such as
-------------------------
.mw-collapsible-toggle {
        width: 70px;
        text-align:right;
}
-------------------------
or something similar. The length of the toggle may vary depending on the Language, so 70px may not be the best option in some cases.
Comment 1 Brion Vibber 2011-08-16 18:33:55 UTC
The existing version seems to avoid this problem by using absolute-positioning for the toggle link instead of a float. The centered text gets positioned based on the surrounding box size, while the toggle link is absolute-positioned within that same box without interfering with the text flow.

The downside there is that if the title text is long, it will overlap the toggle link, whereas the float version will force the text to wrap down to the next line, around the float.
Comment 2 Krinkle 2011-08-24 23:33:20 UTC
Yep, absolute position isn't an option imho because of that.

But neither is a fixed width due to the fact that the toggle is not tied to any specific text. For one, the default text depends on the user language. Secondly users can enter a custom toggle and collapse text through data-attributes. And third, it can also be an image or an entirely different element. So setting a width doesn't make sense.
Comment 3 Erwin Dokter 2011-08-29 17:20:50 UTC
The current navbox model uses a 'fixed' width of 6em for each of the left and right controls to keep the header centered. Using em ensures proper scaling according to font size, and text wraps around it. I don't see why we cannot use the same method in the new collapsible model.
Comment 4 Helder 2011-08-31 20:30:50 UTC
(In reply to comment #2)
> Yep, absolute position isn't an option imho because of that.
> 
> But neither is a fixed width due to the fact that the toggle is not tied to any
> specific text. For one, the default text depends on the user language. Secondly
> users can enter a custom toggle and collapse text through data-attributes. And
> third, it can also be an image or an entirely different element. So setting a
> width doesn't make sense.

Wouldn't be possible for the script itself to check the length of the collapsible toggle text and set the fixed width accordingly?
Comment 5 Rex Schneider 2011-08-31 23:55:27 UTC
Whatever method is used to resolve this issue, the width needs to be specified in em, since absolute units will cause further problems when the browser window is zoomed.
Comment 6 Helder 2011-10-20 19:19:16 UTC
(In reply to comment #2)
> But neither is a fixed width due to the fact that the toggle is not tied to any
> specific text. For one, the default text depends on the user language. Secondly
> users can enter a custom toggle and collapse text through data-attributes. And
> third, it can also be an image or an entirely different element. So setting a
> width doesn't make sense.

BTW: Since I was still using "width: 70px;" on my user CSS, I noticed it broke the formatting of my watchlist, because the toggle is an image there. 

But, wouldn't the following be a solution?

(In reply to comment #4)
> Wouldn't be possible for the script itself to check the length of the
> collapsible toggle text and set the fixed width accordingly?
Comment 7 Ryan Kaldari 2011-11-18 06:42:37 UTC
Perhaps you could add absolute positioning as an option:

data-collapsepositioning="absolute"

Just an idea, but maybe there are better ones.
Comment 8 Erwin Dokter 2011-12-15 13:13:38 UTC
Closing this as WONTFIX. mw-collapsible does not have any CSS associated with it. Any element/template using this feature should incorporate its own local CSS to make the toggle appear and behave as desired.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links