-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix missing options in select tags #6120
Fix missing options in select tags #6120
Conversation
A small improvement on changes from solidusio#6091 where in Rails 7 calling `tag.method(@tag).parameters.any? { |_type, name| name == :content }` would always return false when @tag == :select, since `tag.select` method's signature has only `*` (:rest) as its parameter, thus not passing any `<option>`s for select tag. Somehow the problem was not being flagged by CI builds, but admin specs failed locally. Instead, use explicit void elements list to understand whether given element is void, therefore does not accept `content`.
d7746f7
to
f3e9082
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6120 +/- ##
==========================================
- Coverage 88.68% 86.63% -2.06%
==========================================
Files 830 512 -318
Lines 18013 11818 -6195
==========================================
- Hits 15975 10238 -5737
+ Misses 2038 1580 -458 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 👏🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rails really needs to provide a programmatic way to understand the type of tag from withing a Rails application, isn't it?
Summary
A small improvement on changes from #6091 where in Rails 7 calling
tag.method(@tag).parameters.any? { |_type, name| name == :content }
would always return false when @tag == :select, sincetag.select
method's signature has only*
(:rest) as its parameter, thus not passing any<option>
s for select tag.Somehow the problem was not being flagged by CI builds, but admin specs failed locally.
Instead, use explicit void elements list to understand whether given element is void, therefore does not accept
content
.Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: