[4.0] Allow jForm to support data attribute#27212
Conversation
Co-Authored-By: Nicola Galgano <optimus4joomla@gmail.com>
|
is this a work in progress ? |
|
@twsvaishali please extend this for |
Have added remaining fields in latest commits. Please check. |
Can we start new PR for this? |
seems fine now thanks yes maybe another PR for the |
|
@alikon @twsvaishali for the // Check for aria attribute
if (strpos($name, "aria-") === 0 && array_key_exists($name, $this->ariaAttributes))
{
return $this->ariaAttributes[$name];
}in the main class and some minor adjustments in the layouts. Of course it can be done in another PR to make things easier for testing. I just had to mention that, since a11y is always an afterthought... |
|
@twsvaishali since you're redoing this maybe we could change the layouts logic to: if (!empty($dataAttributes)) {
// Data attributes - data-*
$dataAttribute = '';
foreach ($dataAttributes as $key => $attrValue)
{
$dataAttribute .= ' ' . $key . '="' . htmlspecialchars($attrValue, ENT_COMPAT, 'UTF-8') . '"';
}
}In essence the loop will execute only if there are any |
|
@dgrammatiko Yes. Will start another PR for the aria-* once this is tested and merged. Also I am actually not sure if all fields will have area attribute. |
Co-authored-by: Quy <quy@fluxbb.org>
|
I have tested this item ✅ successfully on d46baf1 Maybe some fields are missing because they did not exist (yet) when this PR was made. It needs someone who checks for completeness and if necessary makes a new PR. Same with the idea to do the same for "aria-" attributes, this should be done in another PR, too. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27212. |
|
I have tested this item ✅ successfully on d46baf1 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27212. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27212. |
|
Thanks all! |
Co-authored-by: Nicola Galgano <optimus4joomla@gmail.com> Co-authored-by: Quy <quy@fluxbb.org> Co-authored-by: George Wilson <georgejameswilson@googlemail.com> Co-authored-by: Richard Fath <richard67@users.noreply.github.com> Co-authored-by: Harald Leithner <leithner@itronic.at>
#16141