Skip to content

Commit a535af2

Browse files
committed
defer
1 parent 0ac9471 commit a535af2

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

app/components/primer/alpha/action_menu/action_menu_element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ export class ActionMenuElement extends HTMLElement {
472472
#handleIncludeFragmentReplaced() {
473473
this.#firstItem?.focus()
474474
this.#softDisableItems()
475-
this.overlay?.update()
475+
// this.overlay?.update()
476476

477477
// async items have loaded, so component is ready
478478
this.setAttribute('data-ready', 'true')

previews/primer/alpha/action_menu_preview/with_deferred_content_near_bottom_of_viewport.html.erb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
<%# The invoker is pinned to the bottom of the viewport so the overlay has no room to grow %>
2-
<%# downward once its deferred content loads, reproducing the scenario from DREAM-729. %>
1+
<%# The invoker is pinned near the bottom of the viewport, leaving enough room for the loading %>
2+
<%# spinner placeholder to fit below it but not enough for the full deferred content, reproducing %>
3+
<%# the scenario from DREAM-729. The `delay` param forces the fragment response to arrive after the %>
4+
<%# overlay has already been positioned using the placeholder's size, instead of racing the fetch %>
5+
<%# against the initial position calculation. %>
36
<div style="position: fixed; bottom: 100px; right: 0;">
47
<%= render(Primer::Alpha::ActionMenu.new(menu_id: "deferred-bottom", src: primer_view_components.action_menu_deferred_path)) do |menu| %>
58
<% menu.with_show_button { "Menu with deferred content" } %>

0 commit comments

Comments
 (0)