Sha256: 278f4940691f7a4e9fb0e9608192f8bec5c2f25fbf6d23139970be69287878a8

Contents?: true

Size: 878 Bytes

Versions: 18

Compression:

Stored size: 878 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" autocomplete="off">
</label>
<script>
  document.querySelector('#my-dialog').addEventListener('close', function () {
    document.querySelector('#input').focus();
  });
</script>

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
primer_view_components-0.36.5 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.52.2 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.36.4 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.52.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.52.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.36.3 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.51.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.36.2 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.50.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.50.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.36.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.36.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.49.2 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.35.2 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.49.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.49.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.35.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.35.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb