Skip to content

Image link spanning full width of the widget container #5897

@parasshah195

Description

@parasshah195

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest stable version of Elementor.

Description

When adding a link to an image, the link spans to to the full width of its parent block (the image widget) irrespective of the image size.

The problem comes when I use an image that does not take the full image widget space (the most common example being the Site Logo), and assign a link to it, the link is clickable outside of image in the black space which is not the expected behaviour. This is coming from .elementor-widget-image .elementor-image>a set to display: block;

I'm not sure why an anchor tag's display property is set to block.

Steps to reproduce

  1. Insert a section or a column.
  2. Add the image widget inside it.
  3. Choose an image and set its width to less than 100%
  4. Assign a link to it
  5. The pointer cursor would show and the link would be clickable outside (besides) that image.

Isolating the problem

  • This bug happens with only Elementor plugin active (and Elementor Pro).
  • This bug happens with a default WordPress theme active.
  • I can reproduce this bug consistently using the steps above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/mergedIndicates when a Pull Request has been merged to a Release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions