joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

create-folder-modal in the media manger made keyboard focused

Open akshitrattan opened this issue 3 years ago • 27 comments

Pull Request for Issue #36881 .

Summary of Changes

Made the create-new-folder modal in the media manager keyboard focused

Testing Instructions

open the media manager and try pressing tab or shift+tab the focus doesn't shift to the backdrop and stays in the modal

Actual result BEFORE applying this Pull Request

on pressing tab the keyboard focus instead of remaining in the modal shifts to the modal backdrop decreasing its accessibility

Expected result AFTER applying this Pull Request

the keyboard focus remains in the modal

Documentation Changes Required

no changes required P.S.- This might have solved the same problem with other modals as I made the changes in administrator/components/com_media/resources/scripts/components/modals/modal.vue

ezgif com-gif-maker

akshitrattan avatar Jan 30 '22 08:01 akshitrattan

Please update with a meaningful title

brianteeman avatar Jan 30 '22 09:01 brianteeman

Please update with a meaningful title

I changed the title, could you please check and confirm whether the title is appropriate

akshitrattan avatar Jan 30 '22 09:01 akshitrattan

I have tested this item :red_circle: unsuccessfully on 5351f6d801dcc23943c5e167e78e15d36306064e


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

brianteeman avatar Jan 30 '22 09:01 brianteeman

The new title is better - thanks

unfortunately my tests do not match your gif and there are two problems.

  1. Focus should not be moved to the X close on open
  2. Can never reach the Create button

media

brianteeman avatar Jan 30 '22 09:01 brianteeman

The new title is better - thanks

unfortunately my tests do not match your gif and there are two problems.

  1. Focus should not be moved to the X close
  2. Can never reach the Create button

media

I can solve the first problem, but i want a clarification that when the modal opens, do you want the focus to be at folder name input and not the close button

akshitrattan avatar Jan 30 '22 10:01 akshitrattan

The new title is better - thanks

unfortunately my tests do not match your gif and there are two problems.

  1. Focus should not be moved to the X close
  2. Can never reach the Create button

media

the second problem is mainly becuase in the variable 'focusableElements' the button:not([disabled]) is there, this means that when the we enter something in the folder name input, the DOM is updated and the button is enabled however, the funtion i created is called before the DOM is updated and thus it is not able to catch the updated DOM

akshitrattan avatar Jan 30 '22 10:01 akshitrattan

I can solve the first problem, but i want a clarification that when the modal opens, do you want the focus to be at folder name input and not the close button

If I remember correctly you do NOT need to do anything to set the focus on load at all.

brianteeman avatar Jan 30 '22 10:01 brianteeman

Member

It was necessary to put the focus on the modal explicitly once it is opened because otherwise focus was set to backdrop buttons As we press the tab button the focus is shifted to the buttons in the backdrop

akshitrattan avatar Jan 30 '22 10:01 akshitrattan

Then you should look at how other (not com_media) modals behave

brianteeman avatar Jan 30 '22 10:01 brianteeman

Then you should look at how other (not com_media) modals behave

I did that is why i made the changes in the modal.vue and not create-folder-modal.vue particulary If you could test the functionality with other modals then it would be great help, as it would tell whether the changes were applied to all the modals or just the create-folder-modal

akshitrattan avatar Jan 30 '22 10:01 akshitrattan

I meant look at modals in other joomla components

brianteeman avatar Jan 30 '22 10:01 brianteeman

I meant look at modals in other joomla components

oh sorry, my bad! @dgrammatiko provided certain links to code snippets of joomla modal component in the comments of the issue, the code I wrote is in a way inspired from that code snippet, as in they work the same

akshitrattan avatar Jan 30 '22 10:01 akshitrattan

when in folder name input section, if we press the enter key it automatically shifts to the create button and the folder is created

akshitrattan avatar Jan 30 '22 10:01 akshitrattan

@brianteeman @dgrammatiko I have solved all the issues with the PR

ezgif com-gif-maker (1)

akshitrattan avatar Feb 03 '22 15:02 akshitrattan

I have tested this item :white_check_mark: successfully on 20be5684e8520216745f479f406d88468be143a9


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

HarshJaiswani avatar Feb 09 '22 14:02 HarshJaiswani

I have tested this item :white_check_mark: successfully on 20be5684e8520216745f479f406d88468be143a9


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

RickR2H avatar Feb 11 '22 16:02 RickR2H

RTC


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

RickR2H avatar Feb 11 '22 16:02 RickR2H

@dgrammatiko I have updated the PR

akshitrattan avatar Feb 16 '22 12:02 akshitrattan

@akshitrattan can you please check your PR? It is out-of-date

drmenzelit avatar Feb 22 '22 14:02 drmenzelit

@akshitrattan can you please check your PR? It is out-of-date

Done!!

akshitrattan avatar Feb 22 '22 14:02 akshitrattan

@akshitrattan it seems you have some code style problems on your Javascript, the build of the package is failing with this errors: https://ci.joomla.org/joomla/joomla-cms/51921/1/25

drmenzelit avatar Feb 22 '22 16:02 drmenzelit

@akshitrattan it seems you have some code style problems on your Javascript, the build of the package is failing with this errors: https://ci.joomla.org/joomla/joomla-cms/51921/1/25

yeah, I am working on those issues, and I did solve a few of them, but there is a particular issue regarding the usage of destructured arrays that I can't seem to solve because I'm not gonna lie, I am a bit unfamiliar with that concept, but I am under the process of researching about it and solving the issue, I hope that works fine?

akshitrattan avatar Feb 22 '22 16:02 akshitrattan

@drmenzelit I have removed all the javascript errors

akshitrattan avatar Feb 22 '22 17:02 akshitrattan

@drmenzelit @dgrammatiko I have successfully solved the issue!!

akshitrattan avatar May 18 '22 13:05 akshitrattan

This pull request has automatically rebased to 4.2-dev.

HLeithner avatar Jun 27 '22 13:06 HLeithner

This pull requests has been automatically converted to the PSR-12 coding standard.

joomla-bot avatar Jun 27 '22 21:06 joomla-bot

@akshitrattan @dgrammatiko if the vue code is now ok, please mark the conversation as resolved

drmenzelit avatar Jun 28 '22 08:06 drmenzelit

Closing this in favor of https://github.com/joomla/joomla-cms/pull/39042

drmenzelit avatar Oct 23 '22 09:10 drmenzelit