Numerous fixes (#312, #338, etc.) + new features!#545
Open
mike-vel wants to merge 1 commit intomicromodal:masterfrom
Open
Numerous fixes (#312, #338, etc.) + new features!#545mike-vel wants to merge 1 commit intomicromodal:masterfrom
mike-vel wants to merge 1 commit intomicromodal:masterfrom
Conversation
* fix: MicroModal.close causing issues It now tracks all modals and active modals instead of one active modal. Fixes micromodal#338 BREAKING CHANGE: Modals now must have ids to function properly. * feat: add MicroModal.config - Initial options are now stored globally - MicroModal.config modifies the configurations of a modal - Big fix: config option does not apply in MicroModal.show * add: initModal and removeModal - Modals are now tracked by modalId (can be modified by setting the identifier in MicroModal.init) - Added initModal: initializes a modal, used for dynamic content - Added removeModal: removes a modal from the allModals list Could Fix micromodal#312 * chore: improve debugMode - Fixes some bugs in debugMode - Improves the debugMode warnings - MicroModal.show now initializes a new modal if it is unregistered * fix: micromodal#421, micromodal#544, and micromodal#372 - Fixes issues micromodal#421, micromodal#544, micromodal#372, and micromodal#523. - Fixes a bug: When removing a modal with animation, showing it again causes the modal to animate then disappear. * docs: add new features - Adds new features in documentation - Fixes some bugs related to highlighting * Update README.md Adds testing version * refactor: separated functions in index,js Refactors some code as well as: - Fixes some behavior when scrolling is disabled - Adds an exported public API * add: support on html elements in functions * refactor: making the code readable * refactor: making the code readable - Adds new comments for easier readability - Improves existing code * add: nanomodal.js - Adds a smaller version of mocromodal.js * fix: focus trap from outside doesn't work Fixes a bug where, if the focus is outside the modal, it does not immediately enter the modal when the user presses the Tab key. This is due to the keydown handler only affecting inside the modal. * Update README.md * fix: micromodal#105, micromodal#490 - Fixes issues micromodal#105, micromodal#490 - Fixes StandardJS errors * add: safeguards to prevent errors - Fixes role="alertdialog" not disabling Escape key presses - Added some safeguards * add(nanomodal): missing features * refactor: remove unnecessary code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here is a pull request that aims to fix multiple issues and add new features:
The code here is from https://github.com/mike-vel/Micromodal-test
Issues fixed:
allModalsandactiveModalsfor the library to access the functions.MicroModal.initare now stored globally in the module, related to fixes #187 #539MicroModal.shownow callsallModals[targetId].showModal()instead of initializing a newModalMicroModal.removeModal, which unregisters a modal and removes its event listeners and triggerskeydownlisteners are now assigned to each modal instead.data-micromodal-closeattribute closes a modal.+ more that I probably didn't mention here
New features:
MicroModal.closeAll(): Closes all active modalsMicroModal.config(targetModal, config): Configures the settings of a specific modalMicroModal.initModal: Initializes a new unregistered modalMicroModal.removeModal: Removes the modals from theallModalslist. Hides the modal and removes all event listeners and triggers before removingrole="alertdialog"now disables theEsckey. (Using this indicates an urgent response from the user)Things to do:
Note
The new pull request is similar to #543 and is there to prevent clutter.