Micromodal | ⭕ Tiny javascript library for creating accessible modal | User Interface library
kandi X-RAY | Micromodal Summary
kandi X-RAY | Micromodal Summary
Tiny, dependency-free javascript library for creating accessible modal dialogs. The aim of this library is to make modal dialogs accessible and easy to include in your project with minimum configuration. It's only ~1.8kb minified and gzipped - A tiny library for big change.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Emit an object
Micromodal Key Features
Micromodal Examples and Code Snippets
Community Discussions
Trending Discussions on Micromodal
QUESTION
I use the micro modal js package in my project but I have a problem. this modal closed when occurring mouse down or mouse up event Outside the medal range. but I want mouse-up event Do not do anything and just mouse-down event can close the medal. this is my HTML code.
...ANSWER
Answered 2021-Jun-06 at 06:23The solution is to remove data-micromodal-close
from your modal__overlay
. Doing that will prevent the modal from closing when you click on the backdrop.
QUESTION
My app has been throwing frequent rack timeout errors, and i think i narrowed the problem down to the size of the compiled javascript file. public/packs/application-5db30a18f8715133f889.js is 2.1mb. this is not doable!
something to note is i have two asset folders: one for sprockets where all my css and most js is, and one for webpacker, which i added solely to use an image upload node package called Upp. i intend to move to webpacker completely, but not yet. this is my app/assets/application.js:
...ANSWER
Answered 2021-Mar-02 at 06:51If you say the problem is from the packs/application
, I would add https://www.npmjs.com/package/webpack-bundle-analyzer to see what webpacker is adding in that file.
Here is how my webpack/development.js
looks like:
QUESTION
I am using FullCalendar to display events from two sources. I have one source to display them as background events and the other set to display as block events.
This works fine, but then I am using the eventClick callback. When I check the info.event.display property of the event clicked on, it returns as auto
. In this callback I need to check this property to determine whether to do something or not.
This also is a problem with the eventDidMount callback. I was using that but have disabled it for now.
IE: In this case I only want a modal to appear if the display type is block.
Code:
...ANSWER
Answered 2021-Mar-03 at 00:29It's because "background" is a property of the event source, not the event. Whilst that rule may then be applied when rendering, to control how the event appears, the event itself doesn't automatically have the value "background" set as the value for its own "display" property (because an individual event can potentially override the event source value for any given property).
Fortunately the event will contain a reference to the event source and, although the path to the information is convoluted (but fortunately discoverable by logging the event object to the Console), you can get the "display" property of the event source from it:
QUESTION
I am using the library micromodal.js to handle the functionality of my (accessible) modal dialogs.
Having read recommendations about a11y best practices, I have learned that the modal should get a tabindex="-1"
in order to "trap" the tabbing user (or screen reader) in the modal dialog.
One of the modals I am using it for has scrollable content section. In order to facilitate the content to be focusable and therefore scrollable by arrow keys, I added tabindex="0"
to the section.
On mobile devices it is not the content that should be scrollable, but the whole modal.
The issue that this solution creates is: when opening the modal on smaller screens, the content is focussed first (due to tabindex of 0 being larger than tabindex of -1, I guess?) and the whole header of the modal is not visible.
The desired behavior is that the modal header is visible when it opens. How could I achieve that with still providing an accessible UX?
Code example: https://codepen.io/AstiV/pen/vYKopNZ
...ANSWER
Answered 2020-Nov-26 at 21:07First of all, you need to review carefully the difference between tabindex=0 and tabindex=-1. Setting tabindex=0 means that the element is focusable, both manually with tab key and automatically via script. Setting element to tabindex=-1 means that only a script can set focus on it, while it isn't possible to focus the element manually.
Knowing this, you should understand what you did wrong. The most obvious solution would be to focus the element with tabindex=-1 when your modal is shown. If for any reason it's much more logical to have the element with tabindex=0 focused when the modal is opened, then you may first focus the element with tabindex=-1, wait for a short while (50-100ms), and then focus the element with tabindex=0.
Concerning scroll, normally, focusing any element (with whatever tabindex or none) should automatically bring it into view it it isn't yet visible, but if is already visible then the scroll shouldn't change. So even by focusing the element with tabindex=-1 and then the one with tabindex=0, the element with tabindex=-1 should stay visible.
QUESTION
In setting up webpacker with my Rails 5.2.4 app, I've introduced this bug to my browser console: Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-plugin-syntax-dynamic-import' from '/Users/me/code/project' - Did you mean "@babel/syntax-dynamic-import"
@babel/syntax-dynamic-import
is not a real package, so what does this mean? Looking through that index.js
file I see no mention of babel-plugin-syntax-dynamic-import
. Furthermore, said plugin is stored in node_modules/@babel/babel-plugin-syntax-dynamic-import
. After reading this I made sure that all my babel packages were on version 7. Except for babel-loader
v8, because v7 was looking for an incorrect dependency.
My package.json
looks alright as far as I can tell:
ANSWER
Answered 2020-Sep-17 at 00:54Solution was to downgrade babel-loader@8.1.0
to babel-loader@8.0.6
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Micromodal
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page