RubyFlow The Ruby and Rails community linklog

Radio Selection Unselect with Stimulus.js

I recently found myself wanting to be alerted on an unselect action so that I could change what was displayed on the page. A small Stimulus controller that waits for the selection event, and emits its own event that other radio button controllers will receive was the perfect solution! https://onrails.blog/2020/09/25/radio-selection-unselect/

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in