Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Dropdown menu overflow #22015

Merged
merged 3 commits into from
Sep 8, 2018
Merged

[4.0] Dropdown menu overflow #22015

merged 3 commits into from
Sep 8, 2018

Conversation

brianteeman
Copy link
Contributor

@brianteeman brianteeman commented Sep 5, 2018

PR for #22012

As seen in the screenshot if the menu text is too long it breaks out of the dropdown. This PR fixes that. Note it doesn't fix the left alignment

@ciar4n nany suggestions

testing requires npm run build:css and changing the language string to something long

before

chrome_2018-09-05_12-49-48

after

chrome_2018-09-05_12-45-39

PR for joomla#22012

As seen in the screenshot if the menu text is too long it breaks out of the dropdown. This PR fixes that. Note it doesnt fix the left alignment

@ciar4nn any suggestions

_testing_ requires npm run build:css and changing the language string to something long
@ciar4n
Copy link
Contributor

ciar4n commented Sep 5, 2018

Appears to be some js applying the following inline styling to the dropdown...

transform: translate3d(-9px, 37px, 0px);

It is that -9px misaligning the dropdown. Javascript is really not my forte, so I have no idea where that should be changed.

@brianteeman
Copy link
Contributor Author

@ciar4n I can't even find the js that is doing that :(

@ggppdk
Copy link
Contributor

ggppdk commented Sep 5, 2018

It is

fileOverview Kickass library to create and place poppers near their reference elements

inside file
media/vendor/bootstrap/js/bootstrap.bundle.js

There was an issue to allow disabling these inline style via JS
so that people can customize positioning themselves

twbs/bootstrap#23378 (Popper.js messing up dropdown styles)
thus they added support for
data-display="static"
with
twbs/bootstrap#24092

So we can add data-display="static" after data-toggle="dropdown" to the layout file to disable it
and then use our custom CSS , to control positioning of the drop down

https://github.com/joomla/joomla-cms/blob/4.0-dev/layouts/joomla/toolbar/dropdown.php#L36

Documentation has not been updated yet ???
https://getbootstrap.com/docs/4.0/components/dropdowns/

You can see data-display="static" here:
https://github.com/twbs/bootstrap/blob/9f742114840e71fd6557ca4fca3dcaaf72452f6d/docs/4.0/components/dropdowns.md

then use something like

.btn-group .dropdown-menu {
    ....
    left: auto;
    right: auto;
    width: auto;
}

which will should also fix current positioning problem for RTL too

@brianteeman
Copy link
Contributor Author

Thanks I will take a look at those links later

@brianteeman
Copy link
Contributor Author

brianteeman commented Sep 6, 2018

Documentation has not been updated yet ???

It has but this is only for BS 4.1 so the link is https://getbootstrap.com/docs/4.1/components/dropdowns/#dropdown-options

@brianteeman
Copy link
Contributor Author

Updated PR and original post. Thanks @ggppdk for pointing me in the correct direction

@cavo789
Copy link

cavo789 commented Sep 8, 2018

I've tested before and once the patch has been apply with Patch tester and I've not see any difference.

The width could be just a little larger in order to correctly display the last letter with a little space to the right.

22015

@brianteeman
Copy link
Contributor Author

@cavo789 https://github.com/joomla/joomla-cms/tree/4.0-dev#how-to-get-a-working-installation-from-the-source

You can not use patchtester alone for testing if/when there are css or js changes as I wrote in the original post

@jehacgn
Copy link

jehacgn commented Sep 8, 2018

I have tested this item ✅ successfully on 66ec5ee


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22015.

@bees4ever
Copy link
Contributor

I have tested this item ✅ successfully on 66ec5ee

Menu Box autosizes with text length as expected.
Also working in other views


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22015.

@ghost
Copy link

ghost commented Sep 8, 2018

Ready to Commit after two successful tests.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Sep 8, 2018
@ghost
Copy link

ghost commented Sep 8, 2018

I have tested this item ✅ successfully on 66ec5ee


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/22015.

@wilsonge wilsonge merged commit 5216225 into joomla:4.0-dev Sep 8, 2018
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Sep 8, 2018
@wilsonge
Copy link
Contributor

wilsonge commented Sep 8, 2018

Thanks guys! Nice teamwork!

@wilsonge wilsonge added this to the Joomla 4.0 milestone Sep 8, 2018
@brianteeman
Copy link
Contributor Author

thanks

@brianteeman brianteeman deleted the width branch September 8, 2018 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants