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

#510 - Fix Button href not updating #548

Merged
merged 2 commits into from
Feb 9, 2024

Conversation

MarvinKlein1508
Copy link

No description provided.

@@ -201,9 +201,6 @@ private void SetAttributes()
if (!Attributes.TryGetValue("role", out _))
Attributes.Add("role", "button");

if (!Attributes.TryGetValue("href", out _))
Attributes.Add("href", To!);

Copy link
Contributor

Choose a reason for hiding this comment

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

@MarvinKlein1508 Instead of changing the markup, please add an else statement for consistency.

@gvreddy04
Copy link
Contributor

@MarvinKlein1508 Please share the scenario in which you are updating the href attribute value of a link. This will help me understand your scenario.

@MarvinKlein1508
Copy link
Author

@gvreddy04 the HREF will be updated when you are using built in Virtualization to display data. There is a minimal repo in #510

@MarvinKlein1508
Copy link
Author

@gvreddy04 the same could also be happening for all other parameters.

Instead of applying them one by one the component should add additional attributes provided by default and use the blazor parameters within the DOM itself.

A common use case for this is displaying lists with links in a virtualized component which uses pagination

@MarvinKlein1508
Copy link
Author

Added another commit. Also applied same logic to Target otherwise this will suffer from the same effect.

Copy link
Contributor

@gvreddy04 gvreddy04 left a comment

Choose a reason for hiding this comment

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

LGTM.

@gvreddy04 gvreddy04 added this to the 1.12.0 milestone Feb 9, 2024
@gvreddy04 gvreddy04 linked an issue Feb 9, 2024 that may be closed by this pull request
@gvreddy04 gvreddy04 merged commit 4e4b776 into vikramlearning:master Feb 9, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ButtonType.Link does not work properly within Virtualize component
2 participants