Sha256: aef3750de2a06aa9d1cefe271077d2c8be41967f967ba798feb0684a9b52790f

Contents?: true

Size: 859 Bytes

Versions: 71

Compression:

Stored size: 859 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('close', function () {
    document.querySelector('#input').focus();
  });
</script>

Version data entries

71 entries across 71 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.33.2 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.33.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.33.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.25.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.32.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.32.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.29.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.29.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.23.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.28.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.28.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.27.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.26.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.25.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.22.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.21.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.25.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.24.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.21.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.20.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb