Fix issues with multiple or DOM-injected CTBs#38
Merged
circlecube merged 1 commit intomainfrom Mar 27, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes issues with multiple CTB triggers and React DOM-injected CTBs by updating how the CTB elements are queried, disabled, and re-enabled, and by streamlining the modal management and event handling logic.
- Consolidated CTB element handling for both native and injected cases
- Updated error handling and modal management functions
- Improved event delegation for CTB and modal close actions
Files not reviewed (1)
- static/ctb.css: Language not supported
Comments suppressed due to low confidence (2)
static/ctb.js:6
- [nitpick] The global variable 'ctbmodal' is ambiguous; consider renaming it to 'ctbModal' for improved clarity and consistency with camelCase naming conventions.
let ctbmodal;
static/ctb.js:139
- Directly outputting 'error' may result in non-informative messages (e.g. "[object Object]") if error is an object; consider checking if error.message exists and using that for a clearer error message.
<h3>${error}</h3>
circlecube
approved these changes
Mar 27, 2025
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.
Proposed changes
Resolves PRESS10-163 and PRESS11-196.
To test:
Type of Change
Production
Development
Checklist