Skip to content

fix(input-date-picker): calendar is displayed on open in Safari#13944

Open
anveshmekala wants to merge 3 commits intodevfrom
anveshmekala/13795-fix-input-date-picker-dropdown-safari
Open

fix(input-date-picker): calendar is displayed on open in Safari#13944
anveshmekala wants to merge 3 commits intodevfrom
anveshmekala/13795-fix-input-date-picker-dropdown-safari

Conversation

@anveshmekala
Copy link
Copy Markdown
Contributor

@anveshmekala anveshmekala commented Feb 18, 2026

Related Issue: #13795

Summary

Fix calendar display in safari when input-date-picker is open in top-layer.

After analyzing layers in both Chrome(144) & Safari (26.2), date-picker wrapper container (.calendar-wrapper) is stacked behind an unkown node in Safari where as in Chrome it is promoted to the front. This workaround solution allows input-date-picker to have it own compositor-layer and promote it

There are other workaround solutions such as enabling top-layer-disabled or forcing repaint of input-date-picker as mentioned here https://codepen.io/jcfranco/pen/qENgLLZ?editors=1111. Disabling top-layer requires complex z-index handling from user & forcing repaint is not seamless in terms of UX.

Related articles: https://web.dev/articles/stick-to-compositor-only-properties-and-manage-layer-count

@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Feb 18, 2026
@anveshmekala anveshmekala marked this pull request as ready for review February 18, 2026 18:12
@anveshmekala anveshmekala added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Feb 18, 2026
@anveshmekala anveshmekala removed the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Feb 18, 2026
Copy link
Copy Markdown
Member

@driskull driskull left a comment

Choose a reason for hiding this comment

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

@anveshmekala I've noticed that safari has an issue with top layer and positioning using absolute. If you set the input-date-picker to use overlay-positioning="fixed" it seems to be fine in Safari.

From what I've seen the position:fixed forces a repaint whereas just using position:absolute does not. I ran into this in the maps SDK as well.

We likely need to open a Safari bug report and this seems to be a much simpler reproduction than what I was able to do in the Maps SDK.

Can we document the workaround and open a Safari bug report for this instead? The other option would be to force position:fixed when Safari is in use but I don't really like that either.

Would love to hear thoughts from others on the team. Especially @jcfranco

async load(): Promise<void> {
// Workaround for Safari issue https://github.com/Esri/calcite-design-system/issues/13795
// ⚠️ browser-sniffing is not a best practice and should be avoided ⚠️
this.compositedLayer = /safari/i.test(getUserAgentString());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not a fan 🪭 of browser sniffing 👃 🙅

@anveshmekala anveshmekala added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Feb 18, 2026
@driskull
Copy link
Copy Markdown
Member

Another potential solution would be to always position floating ui elements using position: fixed if the component does not have topLayerDisabled. This way, we could ensure that all top layer positioning is using fixed positioning. This is a bit too risky to do at this stage though. I really do think we have a Safari bug here as all other browsers don't have this issue.

@driskull
Copy link
Copy Markdown
Member

I don't mind forcing a repaint using CSS if that solution works.

.force-repaint {
  transform: translateZ(0);
}

@driskull
Copy link
Copy Markdown
Member

@geospatialem @DintaMel can we get a new issue to discuss a longer term strategy to make overlayPositioning only apply when topLayerDisabled is present? That way, we can always use fixed positioning when top layer is being used.

Using position of absolute shouldn't be necessary if the top layer is being used.

@DintaMel
Copy link
Copy Markdown
Contributor

@geospatialem @DintaMel can we get a new issue to discuss a longer term strategy to make overlayPositioning only apply when topLayerDisabled is present? That way, we can always use fixed positioning when top layer is being used.

Using position of absolute shouldn't be necessary if the top layer is being used.

@driskull is this different than issue #13150? If it's the same, I'll add the context you provided above to it.

@anveshmekala
Copy link
Copy Markdown
Contributor Author

anveshmekala commented Feb 18, 2026

Another potential solution would be to always position floating ui elements using position: fixed if the component does not have topLayerDisabled. This way, we could ensure that all top layer positioning is using fixed positioning. This is a bit too risky to do at this stage though. I really do think we have a Safari bug here as all other browsers don't have this issue.

Agree on the safari bug, this issue is persistent only with safari and surprisingly not reproducible in some machines ( Ex: Franco). Changing overlay-position did fix the issue but as you mentioned this could be risky atm which may cause regressions to exisiting setup irrespective of the browser.

Regarding below,

.force-repaint {
  transform: translateZ(0);
}

It works and it was used in earlier commits. will-change is a standardized alternative.

@driskull
Copy link
Copy Markdown
Member

@driskull is this different than issue #13150? If it's the same, I'll add the context you provided above to it.

oh, yes we can use that issue and add more context 👍 Thanks!

@driskull
Copy link
Copy Markdown
Member

@anveshmekala I'd rather not do anything safari specific here. Meaning no browser sniffing.

If we want to apply will-change for all browsers and it doesn't introduce any regressions, then I'm good with that.

Otherwise, we can advise users to use fixed positioning until the safari issue is fixed

@anveshmekala
Copy link
Copy Markdown
Contributor Author

@anveshmekala I'd rather not do anything safari specific here. Meaning no browser sniffing.

If we want to apply will-change for all browsers and it doesn't introduce any regressions, then I'm good with that.

Otherwise, we can advise users to use fixed positioning until the safari issue is fixed

I think we can advise this workaround to the users and if they face any layout specific issues they could add this hack in their app perhaps while we continue to figure more robust solution.

@jcfranco
Copy link
Copy Markdown
Member

jcfranco commented Feb 25, 2026

@driskull @anveshmekala Great idea on using this to create a Safari bug repro case.

While browser sniffing should generally be avoided, it does have valid use cases. Here, it could help minimize performance impact on non-Safari browsers (see the warning and proper usage of this property can be a bit tricky sections of will-change), though I’m not sure if this is actually the case. A quick check with Chrome DevTools’ FPS meter should help confirm.

If there is a measurable perf impact, would it be possible to apply the workaround in the beforeOpen hook and remove it in the open hook? That might help minimize the impact window.

Since this is a workaround, it might also be simpler to apply an inline style directly on an internal element with proper workaround comments for context. Adding a reflected prop seems a bit unnecessary for something temporary, and keeping the logic closer should make removal easier later on.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 9, 2026

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Mar 9, 2026
@jcfranco
Copy link
Copy Markdown
Member

@anveshmekala I think we can close this out since there's a workaround and Safari recently landed a fix.

@github-actions github-actions bot removed the Stale Issues or pull requests that have not had recent activity. label Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug reports for broken functionality. Issues should include a reproduction of the bug. pr ready for visual snapshots Adding this label will run visual snapshot testing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants