-
Notifications
You must be signed in to change notification settings - Fork 313
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/1854 #1886
Fix/1854 #1886
Conversation
Do we want to assign someone and finish the PR per Ames comment here #1854 (comment) ? |
As Ames mentioned on #1854, this will need back-end engineering to support the noscript implementation, so it probably can't be merged yet. There's another direction we could go, however. We could just use
The only missing piece would be that the links wouldn't look like checkboxes anymore, which would require some styling, but this PR includes custom styling for checkbox inputs which could be adapted to links fairly easy. |
@JakePT Yes, we like this approach. And what does it look like to replace the checkbox? |
@mckdemps It just means that the checkboxes would look like however we define them, rather than using the styles from the theme, or the default system/browser checkboxes. This is how Ames' checkboxes look in a bare-bones theme: Whereas the current checkboxes, if they aren't styled by the theme, would look like the Checklist checkboxes in the PR description above. This also means that any custom styling users might've applied to facets will not apply to the new checkboxes. An alternative approach would be to include an actual checkbox, but marked up as I prefer the custom checkbox styling approach, as the results will be more consistent between themes, users will be able to more easily style them independently of other checkboxes in their theme, and they would not give the false impression that they will behave the same as system/browser checkboxes. |
@JakePT I'm good with the custom checkboxes as well. Let's go with that approach. |
@mckdemps @brandwaffle I have updated the PR to use links rather than forms, and I've tweaked the styling of the custom checkboxes to use |
Hi @JakePT code looks good and it works correctly. There's a minor space missing from what I can tell on widget.php https://github.com/10up/ElasticPress/pull/1886/checks?check_run_id=2063020128 Can you please take care of it and merge master into this branch? It seems some tests failed on EPIO but I wonder if they would go away once the branch is updated to the latest. |
@oscarssanchez I've merged develop into this branch and fixed the coding standards errors. I'm not sure what the EP.io test you're referring to is so I'll let you have a look at that when the tests are finished. |
Description of the Change
Resolves invalid HTML by:
<input>
checkboxes in facet links, and replace with presentational divs styled as checkboxes.rel="nofollow"
attribute to links without anhref
(i.e. empty terms).Alternate Designs
One alternative option would be to remove the links and implement facets as a
<form>
element. Downsides of that approach are that it would either add the requirement to submit facets manually after selection, or the page would need to refresh upon selection, which would be unexpected behaviour for a form. Additionally, manual submission would require back-end changes to accommodate.Benefits
Resolves invalid HTML of the current facets, and a custom design for the checkboxes would not imply standard form behaviour, which selecting an option does not follow.
Possible Drawbacks
Any custom styles site owners or theme authors may have applied to checkboxes, either generally or just for ElasticPress, would not apply to the new checkboxes.
Verification Process
Running a page with ElasticPress facets through the W3 Validator should not return any errors for facets. Make sure to check the HTML when some empty terms are in the list.
Checklist:
Applicable Issues
#1854
Changelog Entry
Fixed invalid HTML for facets by replacing the
<input type="checkbox">
elements in option links with a custom.ep-checkbox
presentational div.