Sha256: 72a3c25ca898b9b61b2a1ff5ebe827546535b096474b5e609cf6811ec08bf762

Contents?: true

Size: 903 Bytes

Versions: 19

Compression:

Stored size: 903 Bytes

Contents

<%= render(Primer::Alpha::Dialog.new(id: "my-dialog", title: "Confirm focus")) do |d| %>
  <%= render(Primer::Alpha::Dialog::Body.new()) do %>
    Are you sure you want to focus the input?
  <% end %>
  <%= render(Primer::Alpha::Dialog::Footer.new()) do %>
    <%= render(Primer::Beta::Button.new(id: "yes-button", data: { "close-dialog-id": "my-dialog" })) { "Yes" } %>
    <%= render(Primer::Beta::Button.new(scheme: :primary, data: { "close-dialog-id": "my-dialog" })) { "Yes but in green" } %>
  <% end %>
  <% d.with_show_button do |b| %>
    Focus input
    <% b.with_tooltip(text: "This is a tooltip in an Overlay") %>
  <% end %>
<% end %>
<label>
  An input
  <input type="text" id="input">
</label>
<script>
  document.querySelector('#my-dialog').addEventListener('cancel', function () {
    console.log('!!')
    setTimeout(() => document.querySelector('#input').focus(), 0);
  });
</script>

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.20.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.16.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.16.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.19.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.15.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.15.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.18.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.17.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.17.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.14.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.16.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.15.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.14.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.13.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.13.2 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.13.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.13.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.13.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.12.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb