Skip to content

Layout buttons styled as lnks have no disabled state #7085

@docwilmot

Description

@docwilmot

Description of the bug

Layout module allows you to style a button as a link, using the "layout-link-button" class. However buttons styled as links lose the ability to have a disabled state.

Steps To Reproduce

To reproduce the behavior:

  1. Find a link button in core (all the "links" on admin/structure/layouts/manage/dashboard/configure are actually buttons, for example. The code for the 'Add condition' button is on line 764 of layout.admin.inc if needed to demo.
  2. Disable browser JS so you can see its a button
  3. After line 764 of layout.admin.inc, add the #disabled => TRUE attribute to the button element. Clicking the button after this attribute is added will result in no action. The button has been disabled.
  4. Re-enable JS, the button turns back into a link, but now, though it should be disabled (the element even still has `disabled="disabled" if viewed in dev tools) it will submit just as thought its not disabled.

Expected behavior

Links don't have a "disabled" state according to HTML, but since these are actually buttons, we should expect that they shouldnt work if disabled. We should be able to add code that removes the href or prevents the link from working in some way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions