Skip to content

Commit 79d93a5

Browse files
committed
add a method to send the aria message
1 parent 2613b96 commit 79d93a5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/controllers/concerns/op_turbo/component_stream.rb

+4
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ def render_error_flash_message_via_turbo_stream(**)
8484
render_flash_message_via_turbo_stream(**, scheme: :danger, icon: :stop)
8585
end
8686

87+
def render_aria_update_message(role: "alert", message: "asdf")
88+
turbo_streams << OpTurbo::StreamComponent.new(action: :aria, role:, message:, target: "nil").render_in(view_context)
89+
end
90+
8791
def render_flash_message_via_turbo_stream(message:, component: OpPrimer::FlashComponent, **)
8892
instance = component.new(**).with_content(message)
8993
turbo_streams << instance.render_as_turbo_stream(view_context:, action: :flash)

0 commit comments

Comments
 (0)