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

Collapse trigger is wider than the "visual trigger element" #507

Open
blm768 opened this issue Apr 3, 2023 · 1 comment
Open

Collapse trigger is wider than the "visual trigger element" #507

blm768 opened this issue Apr 3, 2023 · 1 comment
Labels
bug Something isn't working workaround

Comments

@blm768
Copy link
Contributor

blm768 commented Apr 3, 2023

Overview of the problem

Oruga version: 0.5.5
Vuejs version: 3.2.45
OS/Browser: Windows 10. Tested in Firefox and Chrome. Probably affects all platforms/browsers.

Description

Like a standard block-layout <div>, the outer trigger <div> for <OCollapse> takes up the full width of its parent. Clicks anywhere within that width will toggle the <OCollapse>, including clicks on areas that appear to be empty background space.

Steps to reproduce

  1. Construct an OCollapse with a trigger slot. (The OCollapse base example in the docs exhibits the behavior.)
  2. Click in the empty space next to the trigger button.
    image

Expected behavior

The <OCollapse> should not toggle its state if its background is clicked rather than one of its child elements.

Actual behavior

The <OCollapse> toggles its state.

Possible Fixes

I can think of a couple of ways this might be fixed:

  1. Style the trigger container such that it doesn't take up the full width of the parent. (Note that if there are multiple child elements within the trigger container, though, especially ones that wrap or have margins between them, there may still be cases where a click on the background would toggle the content.)
  2. Ignore click events whose target is the trigger wrapper rather than a child element (unless the trigger wrapper has no visible children).
@jtommy
Copy link
Member

jtommy commented Apr 25, 2023

You are right, it's a css issues and you can override the style to fix it

@mlmoravek mlmoravek added the bug Something isn't working label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workaround
Projects
None yet
Development

No branches or pull requests

3 participants