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

Add style for disabled anchor elements #1594

Closed
miguelatvaadin opened this issue May 7, 2021 · 4 comments · Fixed by #3204
Closed

Add style for disabled anchor elements #1594

miguelatvaadin opened this issue May 7, 2021 · 4 comments · Fixed by #3204
Labels
enhancement New feature or request Impact: High requires new major This would be a breaking change theme

Comments

@miguelatvaadin
Copy link

Description

The Anchor component implements the HasEnabled interface so it can be disabled, though the disabled attribute is not valid for a elements.

To emulate this feature the Anchor component will be updated so the href attribute is modified when disabled, but it must also have some visual effect so the user understands that the link is not clickable anymore.

Current behavior

Nothing happens when the Anchor element is disabled

Expected behavior

The visual appearance of the link changes when the Anchor component is disabled

References

vaadin/flow#10924

@rolfsmeds
Copy link
Contributor

rolfsmeds commented May 11, 2021

To be consistent with other components, the disabled link should use color: --lumo-disabled-text-color;

I do have one concern about this: If there are Vaadin applications out there that use anchors without href but with onclick handling instead, this change will make all those links look disabled, in which case this would be a breaking change (i.e. not backported to V14).

(@jouni do you have anything to comment here?)

@vaadin-bot vaadin-bot transferred this issue from vaadin/vaadin-lumo-styles May 19, 2021
@vaadin-bot vaadin-bot added enhancement New feature or request Impact: High needs design Design is needed theme labels May 19, 2021
@rolfsmeds
Copy link
Contributor

The disabled state has already been fixed in the Flow component by removing the href attrib: vaadin/flow#11121

@rolfsmeds
Copy link
Contributor

rolfsmeds commented Aug 3, 2021

Also cursor should revert from pointer to default (if that does not already happen automatically when the href attrib is removed), and the hover effect (underline) suppressed.

@rolfsmeds rolfsmeds added the requires new major This would be a breaking change label Oct 14, 2021
@rolfsmeds
Copy link
Contributor

Acceptance criteria:

  • Anchors without href should use --lumo-disabled-text-color
  • Only anchors with href should have hover style (underline)
  • Anchors without href should use default cursor (rather than pointer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Impact: High requires new major This would be a breaking change theme
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants