-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Tag form field type removing selected tags from nested multiselect list #43705
Comments
|
This must be happening in the new javasript that has replaced the J3 chosen behaviour. Not sure where that is? |
Yeah. The script for dropdown comes from Choices.js https://github.com/Choices-js/Choices I would close current issue, as it is not Joomla issue. |
Thanks @Fedik .
|
CORRECTION - It is a Joomla issue Choices.js has an option:
So joomla needs to set renderSelectedChoices to Or something like that. (obviously if the mode for the field ia |
Ok so I can see how to fix it for nested tags, but not being that familiar with Joomla core dev decisions, or testing procedures, or javascript I am not competent to work this up into a PR. Here's what I have found. The joomla interface to Choices.js for this is handled by In the case of tags it seems to me that if NB what follows is specific to the tag form field type - I am not sure what other fields types have a nested mode and are using fancy-select so would need the same treatment. Solution;
Probably also add a comment at about line 20 documenting what this is for
For a quick hack inserting the following at about line 124 (accounting for the addition above) in
As I said above this works fine for nested tag fields, It needs someone with an understanding of what other things might be impacted to work this into a PR - I'm afraid that is somewhat beyond my paygrade, but I hope this helps for starters. |
Thanks for finding. Just add it here joomla-cms/build/media_source/system/js/fields/joomla-field-fancy-select.w-c.es6.js Lines 125 to 144 in cba319d
It will be fine as default. As long as it is not selectable after initial selection. |
Hmm, my feeling is that if the mode is not nested (ie It is much better for the user in that case if the already selected items are removed from the list. (this was the case in J3) So you do need to only do it when the mode is nested, hence the change to the tag layout file to get the value to pass to fancy-select, and to get the value to conditionally set renderSelectedChoices in fancy-select In the nested case where selected items remain in the list then they must be greyed out as not selectable - so you still need to add the |
There are also two further bugs in the tag field definition itself to do with displaying the list which I will raise as a separate issue as they are independent of this one. |
You can use |
Steps to reproduce the issue
In J5.1.1 have a tag form field with
mode="nested"
andmultiple="true"
attributesUse the field to select a tag with children
Do the same in J3.10
Expected result
J5 should still list the selected item, but grey'd out so it can't be double selected but you can still see the nested structure.
This was the behaviour in J3, and having the selected item removed from the list means that its child tags now appear as children of the tag above its original place in the list. Great confusion for user.
Actual result
The selected tags are removed from the dropdown list so the user no longer sees the correct nested structure
System information (as much as possible)
J5,1,1
Apache 2.4.59 on Ubuntu
Php 8.1.29, same on 8.2
Additional comments
see attached screenshots
![J5tag-before-select](https://private-user-images.githubusercontent.com/44980188/342930590-0a97f06e-9c91-4c1c-9e8e-c8d21cc2fb66.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwODYyODAsIm5iZiI6MTcyMzA4NTk4MCwicGF0aCI6Ii80NDk4MDE4OC8zNDI5MzA1OTAtMGE5N2YwNmUtOWM5MS00YzFjLTllOGUtYzhkMjFjYzJmYjY2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA4VDAyNTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI0Y2QxNzcxMTY4ZjYwMDVlMTZhZjk2MWNkNDliZjZhNDNjMWQ5M2VkNDM4ZWFiYWNjNzE4ZTE3ODNmNTE3MTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.kmXng4B6t_GLcP9IMliQtx-QDxEe3ufpbPDSNhDajDM)
Joomla 5 before selection of a tag:
Joomla 5 after selection of a tag. Note that the child tags of "Love" now appear as if children of "Worldwide"
![j5tag-after-select](https://private-user-images.githubusercontent.com/44980188/342930913-c1137280-3904-4caa-bad2-aa885a6bec8d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwODYyODAsIm5iZiI6MTcyMzA4NTk4MCwicGF0aCI6Ii80NDk4MDE4OC8zNDI5MzA5MTMtYzExMzcyODAtMzkwNC00Y2FhLWJhZDItYWE4ODVhNmJlYzhkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA4VDAyNTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk4NWZmYjkxMGEzYjVkZjk3N2I5MmYyNmQ2OGQ0OGUzZmNjYjdkMTRhODI1MzAxZTVkOTc2MGY1YjgwMjJmYmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.5wRIikouSrXWSHSVPioAfiD4-U_4knRGmn-2oTjOeL0)
For coparisson the J3 version after selecting a tag still shows it in place in the list but grey'd out so that you can still see the child relationships correctly
![J3tag-nested-multi](https://private-user-images.githubusercontent.com/44980188/342931189-f4c7384a-78ef-4806-a352-8cd8aa7b21bc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMwODYyODAsIm5iZiI6MTcyMzA4NTk4MCwicGF0aCI6Ii80NDk4MDE4OC8zNDI5MzExODktZjRjNzM4NGEtNzhlZi00ODA2LWEzNTItOGNkOGFhN2IyMWJjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA4VDAyNTk0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE2M2YzYTNlOTQyZmU0Y2E3OTRiOGY0MWUyYjkzY2IxMWIyODFkYmE3MWI3YzI2MTlhZTZhNDg3ZjkwMzg2MDQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.TwlvKyaXcgelAvz4APxCCkukhT0dcu6-pek3dqQdVig)
The text was updated successfully, but these errors were encountered: