Skip to content

Scroll down to show dropdown menu#11687

Merged
alecslupu merged 1 commit intodevelopfrom
fix/11307
Sep 29, 2023
Merged

Scroll down to show dropdown menu#11687
alecslupu merged 1 commit intodevelopfrom
fix/11307

Conversation

@fblupi
Copy link
Copy Markdown
Member

@fblupi fblupi commented Sep 29, 2023

🎩 What? Why?

Scroll down when clicking on the "Jump to" button of dropdown menus.

As I think it's not feasible to use this behavior as the default one, I included data-scroll-to-menu for the dropdown buttons where you want to use it.

📌 Related Issues

Testing

From a mobile phone:

  1. Go to a conference or participatory space.
  2. Click on the "Jump to" button.
  3. See the page scrolls down so the menu is shown.

📷 Screenshots

Screen.Recording.2023-09-29.at.14.01.51.mov

♥️ Thank you!

@fblupi fblupi added module: core module: conferences type: fix PRs that implement a fix for a bug project: redesign Barcelona City Council contract no-backport Pull Requests that should not be backported labels Sep 29, 2023
@fblupi fblupi requested a review from a team September 29, 2023 14:13
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alecslupu alecslupu added this to the 0.28.0 milestone Sep 29, 2023
@alecslupu alecslupu merged commit 240b57d into develop Sep 29, 2023
@alecslupu alecslupu deleted the fix/11307 branch September 29, 2023 21:06
entantoencuanto added a commit that referenced this pull request Sep 30, 2023
* develop:
  Scroll down to show dropdown menu (#11687)
  Fix title for Spaces in edit admin page (#11670)
  Fix missing attachments in initiatives (#11680)
@@ -0,0 +1,10 @@
$(() => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the way we're proposing to work with javascripts. Not only due to you're trusting on JQuery to make it work, but the logic behind is not being initializated in the index.js file, within the initializer function.

In the following lines, you'll notice how we can control when a javascript file is really being used or not:

element.querySelectorAll('[data-component="accordion"]').forEach((component) => createAccordion(component))
// https://github.com/jonathanlevaillant/a11y-dropdown-component
element.querySelectorAll('[data-component="dropdown"]').forEach((component) => createDropdown(component))
// https://github.com/jonathanlevaillant/a11y-dialog-component
element.querySelectorAll("[data-dialog]").forEach((component) => createDialog(component))
// Initialize available remote modals (ajax-fetched contents)
element.querySelectorAll("[data-dialog-remote-url]").forEach((elem) => new RemoteModal(elem))
// Add event listeners to identity modal
element.querySelectorAll("[data-user-identity]").forEach((elem) => selectActiveIdentity(elem))
// Initialize data-tooltips
element.querySelectorAll("[data-tooltip]").forEach((elem) => createTooltip(elem))
// Initialize data-toggles
element.querySelectorAll("[data-toggle]").forEach((elem) => createToggle(elem))
element.querySelectorAll(".new_report").forEach((elem) => changeReportFormBehavior(elem))

cc/ @decidim/maintainers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: conferences module: core no-backport Pull Requests that should not be backported project: redesign Barcelona City Council contract type: fix PRs that implement a fix for a bug

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Mobile: “Jump to” menu opens outside of visible area

3 participants