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

Fix initial value in type selectbox #141

Merged

Conversation

fuelen
Copy link
Contributor

@fuelen fuelen commented Nov 21, 2022

solves issue in the comment
#123 (comment)

@DavidMStraub
Copy link
Member

Thanks for the fix! Still, I'd like to avoid not rendering the entire component during loading data, which could take seconds. I hope we can find a workaround.

@fuelen
Copy link
Contributor Author

fuelen commented Nov 27, 2022

Spinner? :)
I think it should be absent by default, as most of the loadings are very fast. If we definitely know that loading is time-consuming for some element, then spinner should be toggled explicitly using some option

@fuelen
Copy link
Contributor Author

fuelen commented Dec 27, 2022

Hey @DavidMStraub

Do you have other ideas?
What is the downside of not rendering the component during loading data? Is it solely UX issue?

@DavidMStraub
Copy link
Member

Hi, sorry for not making progress on this. Yes, I would like to avoid elements popping up when something has loaded. In principle, the "Loading items..." text was a reasonable loading state IMO, but as you found out it causes problems with the label when the mwc-select is loaded too early. I think it's a bug in the material web components library. Alternatively, we could think about using something like the <span class="skeleton"> animation that is used in some places now.

@fuelen fuelen force-pushed the fix/initial_value_in_type_selectbox branch from 7856508 to bb2d30d Compare January 5, 2023 18:05
@fuelen
Copy link
Contributor Author

fuelen commented Jan 5, 2023

@DavidMStraub I've updated a PR, please take a look

@fuelen fuelen force-pushed the fix/initial_value_in_type_selectbox branch from bb2d30d to 541a57f Compare January 5, 2023 18:13
@DavidMStraub
Copy link
Member

Thanks! Just to understand, which part of it actually fixes the overlapping label? Is it that you select the mwc-select to disabled when loadingTypes is True?

@fuelen
Copy link
Contributor Author

fuelen commented Jan 7, 2023

@DavidMStraub Honestly, I don't have a strong opinion why the fix works 😄 disabled attribute is a cosmetic change only, the fix works even if I hardcode disabled to false.
I noticed, that for some select components, loadingTypes was always false if I print it in render function. But, I tried to synchronize it with types and got the expected result.

@DavidMStraub DavidMStraub merged commit 2cb9dff into gramps-project:main Jan 8, 2023
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

Successfully merging this pull request may close these issues.

2 participants