Skip to content

[5.3] - Allow fancy-select renderSelectedChoices attribute to be overridden #45558

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

Open
wants to merge 9 commits into
base: 5.3-dev
Choose a base branch
from

Conversation

travisrisner
Copy link
Contributor

Pull Request for Issue #45536 .

Summary of Changes

This PR introduces support for a new optional data-render-selected-options XML attribute in <field type="list" layout="joomla.form.field.list-fancy-select" />. This allows developers to customize the rendering behavior of selected options by passing the value directly into the underlying data-render-selected-options attribute used in the fancy-select JavaScript, rather than relying on a hardcoded option. If the data attribute does not exist, it will default to a value of "always".

I've also went through the source and identified and modified the flat lists I believe could benefit from this attribute, and left it off of the lists that have "nested" behavior (like categories). It's possible I might have missed some.

I'm truly unsure if utilizing an data-* attribute in this way is a good solution, but thougth I'd go ahead and submit this and see what feedback I get.

If this is a valid solution, I do think it might still be beneficial to implement some CSS similar to the quick example I added to that initial issue, so that if the options are retained there is at least some easier visual feedback for which items are selected.

Testing Instructions

  • Edit a user on the administrator portal
  • Click the User Actions Log tab
  • Toggle on the Email Notifications option
  • On the list of extensions, select an item from the list and it should disappear from output
  • After that is verified, navgiate to Content -> Articles and toggle on the Filter Options on the search
  • Select a parent item from the category filter selection and the parent item should still be listed

Actual result BEFORE applying this Pull Request

All fancy-select lists retained the selected options

Expected result AFTER applying this Pull Request

Just specific fancy-select lists will retain the selected options

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@ceford
Copy link
Contributor

ceford commented Jun 10, 2025

I can't follow the testing instructions! I am using J5.3.2-dev (a clone). In the user edit form there is no User Actions Log tab. In the User Actions Log / Options page there is no Email Notifications option in the list. In the filtered list of articles I don't really know what I am looking for! Some screenshots might help.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45558.

@travisrisner
Copy link
Contributor Author

I can't follow the testing instructions! I am using J5.3.2-dev (a clone). In the user edit form there is no User Actions Log tab. In the User Actions Log / Options page there is no Email Notifications option in the list. In the filtered list of articles I don't really know what I am looking for! Some screenshots might help.

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45558.

That's my mistake. I forgot a step, the User Actions Log plugin has to be enabled for that tab to be visible when editing a user. System -> Plugins -> search for "log" and enable the System - User Actions Log.

The testing for the category filter is more so to make sure I didn't mess with what was previous done to resolve the visual error on that.

I'll see if I can work up some screenshots and maybe some better instructions for a place to test that doesn't require a plugin to be enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NPM Resource Changed This Pull Request can't be tested by Patchtester PR-5.3-dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants