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

Bug: flash of default styles due to Stencil bug with hydratedFlag #991

Open
eriklharper opened this issue Sep 15, 2020 · 17 comments
Open

Bug: flash of default styles due to Stencil bug with hydratedFlag #991

eriklharper opened this issue Sep 15, 2020 · 17 comments
Labels
0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. Calcite (dev) Issues logged by Calcite developers. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. p - medium Issue is non core or affecting less that 60% of people using the library spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment. Stencil bug Issues that are tied to a reported Stencil bug.

Comments

@eriklharper
Copy link
Contributor

eriklharper commented Sep 15, 2020

Summary

This bug is due to an issue with how Stencil applies CSS for the hydratedFlag config option: ionic-team/stencil#2245. This bug would be a workaround to temporarily fix the flashing while Stencil works on a more permanent solution.

Actual Behavior

When loading the page and on subsequent reloads, a flash of default styling appears on components in certain scenarios.

Expected Behavior

The correct styling should appear without any flash of incorrect styling based on the supplied props.

Reproduction Steps

  1. Render a calcite-label with a scale set to s or l
  2. Reload the page multiple times and notice the flash of the medium font size
  3. Observe in the DOM that the calcite-hydrated attribute takes a second to apply before the correct font size is shown.
<calcite-label scale="s">Test Label</calcite-label>

Relevant Info

@eriklharper eriklharper added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Sep 15, 2020
@paulcpederson
Copy link
Member

I think I may have found a temporary workaround for this. Basically, we can select elements that are :not hydrated and hide their contents in the global css file:

calcite-accordion:not([calcite-hydrated]) * {
  visibility: hidden;
}

Further, this flash only happens when components contain a slot. If a component doesn't have a slot, it won't show anything until js runs anyway, where stencil's hydrated functionality will work fine. This makes the list smaller in our css.

Elements with slots are:

calcite-accordion
calcite-accordion-item
calcite-action
calcite-action-bar
calcite-action-group
calcite-action-pad
calcite-alert
calcite-block
calcite-block-section
calcite-button
calcite-card
calcite-checkbox
calcite-chip
calcite-combobox
calcite-combobox-item
calcite-date
calcite-dropdown
calcite-dropdown-group
calcite-dropdown-item
calcite-flow
calcite-input
calcite-input-message
calcite-label
calcite-link
calcite-modal
calcite-notice
calcite-panel
calcite-pick-list/shared-list-render
calcite-pick-list-group
calcite-pick-list-item
calcite-popover
calcite-radio-button
calcite-radio-button-group
calcite-radio-group
calcite-radio-group-item
calcite-scrim
calcite-shell
calcite-shell-center-row
calcite-shell-panel
calcite-sortable-list
calcite-split-button
calcite-stepper
calcite-stepper-item
calcite-tab
calcite-tab-nav
calcite-tab-title
calcite-tabs
calcite-tile-select
calcite-tile-select-group
calcite-tip
calcite-tip-group
calcite-tip-manager
calcite-tooltip
calcite-tree
calcite-tree-item
calcite-value-list-item

@eriklharper eriklharper added the p - low Issue is non core or affecting less that 10% of people using the library label Nov 13, 2020
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Jan 13, 2021
@julio8a julio8a added the Stencil bug Issues that are tied to a reported Stencil bug. label Jan 27, 2021
@github-actions
Copy link
Contributor

This issue has been automatically closed due to inactivity.

@paulcpederson
Copy link
Member

ionic-team/stencil#2989 looks like they are going to allow us to opt out of the default stencil hydrated style visibility. That would enable us to actually fix this.

@paulcpederson paulcpederson reopened this Aug 11, 2021
@paulcpederson paulcpederson added this to the Back burner milestone Aug 11, 2021
@paulcpederson paulcpederson self-assigned this Aug 11, 2021
@paulcpederson paulcpederson removed the Stale Issues or pull requests that have not had recent activity. label Aug 11, 2021
@jcfranco jcfranco added the 1 - assigned Issues that are assigned to a sprint and a team member. label Aug 14, 2021
@jcfranco
Copy link
Member

@paulcpederson Thanks for the update! Do you think you'll be able to take this on this current sprint? Otherwise, I'll unassign and label this as help wanted.

@jcfranco jcfranco added help wanted Issues that the core team needs help with in a sprint. 0 - new New issues that need assignment. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Aug 25, 2021
@paulcpederson paulcpederson added 2 - in development Issues that are actively being worked on. and removed 0 - new New issues that need assignment. labels Jul 6, 2022
@paulcpederson paulcpederson self-assigned this Jul 6, 2022
@jcfranco jcfranco added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Jul 9, 2022
@benelan benelan added the p - high Issue should be addressed in the current milestone, impacts component or core functionality label Jul 15, 2022
@benelan benelan modified the milestones: Back burner, Stalled Jul 15, 2022
@benelan benelan added the blocked This issue is blocked by another issue. label Jul 15, 2022
@benelan benelan added 0 - new New issues that need assignment. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Dec 12, 2022
@benelan benelan added the Calcite (dev) Issues logged by Calcite developers. label Jan 30, 2023
@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Mar 30, 2023
@benelan benelan added 0 - new New issues that need assignment. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Jun 27, 2023
@benelan benelan removed their assignment Jun 27, 2023
@jcfranco
Copy link
Member

Blocked by #10310.

Copy link
Contributor

Issue #10310 has been closed, this issue is ready for re-evaluation.

cc @geospatialem,@DitwanP

@github-actions github-actions bot removed the blocked This issue is blocked by another issue. label Nov 26, 2024
@geospatialem geospatialem added needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment. labels Nov 26, 2024
@geospatialem geospatialem removed this from the Stalled milestone Nov 26, 2024
@geospatialem
Copy link
Member

Added a spike to determine if the migration from Stencil to Lumina mitigates the above, or if additional follow-up is needed.

@geospatialem geospatialem added p - medium Issue is non core or affecting less that 60% of people using the library and removed p - high Issue should be addressed in the current milestone, impacts component or core functionality labels Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. Calcite (dev) Issues logged by Calcite developers. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. p - medium Issue is non core or affecting less that 60% of people using the library spike Issues that need quick investigations for time estimations, prioritization, or a quick assessment. Stencil bug Issues that are tied to a reported Stencil bug.
Projects
None yet
Development

No branches or pull requests

9 participants