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

Button Visibility Unexpected Behaviour #3217

Closed
TorreyGarland opened this issue Dec 8, 2021 · 8 comments
Closed

Button Visibility Unexpected Behaviour #3217

TorreyGarland opened this issue Dec 8, 2021 · 8 comments

Comments

@TorreyGarland
Copy link

Possibly related to Issue #2729.

I have a Blazorise Field with three (3) buttons. I want to conditionally hide or display the middle button.

Setting its visibility to invisible does hide the button, but the space that it occupies remains instead of collapsing the third/last button next to the first one.

Any ideas?

@TorreyGarland TorreyGarland added the Type: Bug 🐞 Something isn't working label Dec 8, 2021
@stsrki
Copy link
Collaborator

stsrki commented Dec 8, 2021

Visibility is used to hide the element while still preserving the space. To really hide the element use the Display parameter. Eg.

Display="Display.None" to hide it, and Display="Display.Block" to show it.

@David-Moreira
Copy link
Contributor

@TorreyGarland I'm guessing this solved your problem, right?
It is known that in html you can either have an invisible element, or straight up not display it, so closing issue as this does not seem like a bug.

@stsrki stsrki removed the Type: Bug 🐞 Something isn't working label Dec 22, 2021
@TorreyGarland
Copy link
Author

apologies for the delay. yes, it did fix the problem.

@ruisantos78
Copy link

Using Display to hide a button doesn't make sense in an MVVM scenario.

Since Visibility is an enum, could it include a "Collapse" option to hide the element like display none?

@stsrki
Copy link
Collaborator

stsrki commented Oct 7, 2023

Using Display to hide a button doesn't make sense in an MVVM scenario.

Since Visibility is an enum, could it include a "Collapse" option to hide the element like display none?

It seems like a good idea, and fairly simple to do. Can you open a new ticket?

@TorreyGarland
Copy link
Author

No.

@stsrki
Copy link
Collaborator

stsrki commented Oct 19, 2023

No.

I'm sorry, but did we offend you in any way?

@TorreyGarland
Copy link
Author

Not at all. I have a solution that is a little more flexible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants