-
-
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
[4.0] Subform custom element #19184
[4.0] Subform custom element #19184
Conversation
Great work @Fedik Merry Christmas to you too!! 🎉 |
This PR just moves the source code to the /build/webcomponents folder so the command `$ grunt createElements` will take care of the es5 (for IE11)
Another thing about the sortable functionality: it needs to be keyboard accessible. I have no clue if either the draggula or the airbnb script are accessible! Anyways some time ago @brianteeman pointed out some resource about accessible drag and drop: https://www.sitepoint.com/accessible-drag-drop/ |
Make an es5 copy as well
@dgt41 current problem is to make the sorting to work, at least 😄 because it is now a custom element, I do not think it will be good idea to have "external dependency" as you already told, can be need to merge in to single file |
@dgt41 and idea, |
@Fedik let's create couple codepens with deferent approaches and let the a11y and design team decide which way the want to go. For me anything that fulfils the requirements is good enough! 😃 |
@Fedik would be easy to implement but we'd be going backwards rather than forwards. J3 supports drag-n-drop and J4 only allows you to move rows 1 place at a time |
@C-Lodder J3's drag and drop is not accessible, the point is accessibility here, if we can replicate J3 dnd in accessible fashion lets do it, else let's do something that is accessible... |
Brian shared a link for an a11y dnd a while back. It's definitely possible |
it an evolution loop 😄 for now I do not have any solution
the problem with that example, that it use HTML5 |
up - down arrows are not an improvement and they are not better for accessibility It is perfectly possible to provide keyboard support for drag and drop |
@Fedik do you want to experiment on the code of site point that @brianteeman posted above? |
@dgt41 I will try on next weekend, |
@Fedik check I can live with a CE wrapper (joomla-sortable) for this lib ;) |
@dgt41 I seen that, but somehow I do not liked that 😄 If use of external lib, then I would stop on https://github.com/Shopify/draggable they declare Accessibility support https://github.com/Shopify/draggable/search?q=accessibility&type=Issues&utf8=%E2%9C%93 for now I try native HTML 5 dragable API, with some polyfill for mobile browsers |
note for me keymap:
|
Conflicts: layouts/joomla/form/field/subform/repeatable-table.php layouts/joomla/form/field/subform/repeatable.php
Update repeatable.php
@dgrammatiko done, thanks! |
I have tested this item ✅ successfully on bdaf42d This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19184. |
As the tests got moved to a separate repo you need to create a pr with the tests in the JS testing repo and remove them from here. |
@laoneo and thats why it was not the best decision |
@laoneo since all tests are basically nullified we can safely remove them in this PR as well. |
so I will agree this is bad for the short term but once the tests are done correctly this would be a better solution. (the main advantage is that if a PR breaks some tests this will be very obvious and since we want to keep B/C tests should never break, at least that's part of the theory there) |
@brianteeman I wasn't part of that decision and do not know all the pros and cons. For now, if the tests are unnecessary then lets remove them in this pr and add them later. |
@Fedik can you resync this (basically you will have to delete the tests as these were deleted few days ago) |
Conflicts: tests/javascript/joomla-field-subform/fixtures/fixture.html tests/javascript/test-main.js
…into subform-custom-element
@Fedik can this be tested by creating a new list custom field as it uses subforms? |
@laoneo it should work as it was before, everywhere where |
I have tested this item ✅ successfully on bdaf42d This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19184. |
I have tested this item ✅ successfully on bdaf42d This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19184. |
Ready to Commit after two successful tests. |
Can you please open a new issue with the problem. Thanks for understanding. |
Summary of Changes
Convert subform.js to custom element
<joomla-field-subform />
Testing Instructions
Add subform field in to an any form, and check whether it works as usual.
Documentation Changes Required
yes I think
Todo:
@dgt41 Christmas present to you 😄