RRUI-002 · Select · Turbo Frames
When a form using rui_select lived in a Turbo Frame and validation failed (422), the frame replaced and the select could appear duplicated — native RRUI chrome stacked with a second enhanced select UI.
data-rui marker so global initialisers (e.g. Materialize) can be scoped with select:not([data-rui]). That one-line host change was applied in StockLive’s initialiser. Only apps with a global enhancer need it; the marker ships to everyone.
| Component |
RapidRailsUI::Select::Component (f.rui_select) |
|---|---|
| Status | Fixed in 0.51.2 (marker) + host scope where enhancers exist |
| Cause | No durable opt-out for legacy / global select enhancers on Turbo Frame replace |
| Now |
data-rui on native controls; hosts use select:not([data-rui])
|
f.rui_select(…) inside a turbo_frame_tag form.turbo:frame-load / turbo:load.:not([data-rui]).<select … style="background-image: url('…chevron…')">
<option>…</option>
</select>
CSS-only. No Stimulus. Documented as “no JavaScript required.”
The new markup had no “already enhanced” state. Host code that did document.querySelectorAll('select') + M.FormSelect.init wrapped it again.
data-rui (or equivalent) markerbrowser-default classdata-rui marker on every native form control.select:not([data-rui]).document.querySelectorAll('select:not([data-rui])')