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.48.2 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.48.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.48.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.47.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.47.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.34.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.46.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.46.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.45.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.44.3 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.44.2 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.44.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.33.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.44.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.43.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.43.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
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.42.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
primer_view_components-0.31.0 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb
openproject-primer_view_components-0.41.1 previews/primer/alpha/tooltip_preview/tooltip_with_dialog_moving_focus_to_input.html.erb