This is the talk page for discussing improvements to the ShowCustomModal page.
- Please sign and date your posts by typing four tildes (
~~~~). - Put new text under old text. Click here to start a new topic.
- If you're new to the wiki, please take a look at the talk page help.
- Be polite
- Assume good faith
- Be welcoming
Mistakenly erasing the passed options
Thank you for making this. I tried to fix the Medals script with the assistance of this, but it looks like lines 291-292 in the ShowCustomModal script erase the options object for no reason. However I don't feel assured enough to go ahead and fix it myself. Nam 23:05, January 25, 2021 (UTC)
uhh
the infobox is completely in german crknt 16:53, 3 February 2021 (UTC)
- Not for me, I don't see it. Is your user language set to german? The page doesn't even have LangSelect enabled -D 17:59, 3 February 2021 (UTC)
- Kocka helpfully null edited the page and fixed it silently, leaving no logs, traces, and without TELLING ME, so Germans shouldn't be a problem anymore -D 18:05, 3 February 2021 (UTC)
CSS
Intended? Why would somebody want to use old styles? (maybe because copy-pasting from old stylesheet) --TreeIsLife (talk) 15:58, 7 February 2021 (UTC)
- @Doru You should answer this. --TreeIsLife (talk) 16:04, 7 February 2021 (UTC)
- It's my library, I'd get around to answering eventually
- The one who deleted your CSS was Kocka, but I'd have done the same thing anyway, ShowCustomModal's styles are meant to be preserved from how they looked like before the migration of UCP
- Sure, if someone wants to have a modern look, they can use alternatives like Modal which intentionally tries to mimic the look of everything else OOUI-based, but ShowCustomModal tries to preserve backwards compatibility with how things looked before, so no problems arise
- If someone's interested in modernizing their own modal, they can add CSS that only affects their modal specifically, or use one of the other libraries -D 01:28, 8 February 2021 (UTC)
- Yes, but even when using own one, it will still use old styles, but thx TreeIsLife (talk) 08:02, 8 February 2021 (UTC)
- How so? You can use CSS specificity to override any of the styles currently set by the script, so you can really style the modal however you want (within reason, you're still constrained by the HTML...) -D 08:08, 8 February 2021 (UTC)
- Yes, but even when using own one, it will still use old styles, but thx TreeIsLife (talk) 08:02, 8 February 2021 (UTC)
Accessibility issue
I found out that importing Discord.js on dark-themed wikis may cause white screen flickering after clicking an image in article content. I don't know how, but it's directly related to having this script imported and removing it solved the issue.
Unexpectable effects like that are rather serious accessibility issues that make browsing a wiki possibly even dangerous for people e.g. with epilepsy, so I'd appreciate if you investigate. Here's your example:
Thank you, — Rail (talk | contribs) 20:54, 11 February 2021 (UTC)
- The script was generally lacking in the area of fitting with wiki themes at all, the modal is a blinding white with a slightly transparent white backdrop, which would've blinded if you actually tried to open a modal
- Granted, the flash of white was something to avoid, so I added CSS variables to the modal styles to preserve pretty much the same styles on light wikis but dark on dark themed wikis. This also meant that the backdrop in light wikis is now dark, so maybe that's a good thing for some, I'll see if I can undo the accidental change some other day
- Just the CSS variables wasn't enough, so I also added some patches to update other things like the modal's border color and box shadow, and also changed how secondary buttons looked because they had no text contrast
- The script should in general be way more usable on dark wikis, but there's also not the problem of a white flash with the LightBox modal because of it reusing the same classes as ShowCustomModal (I thought
.modalWrapperand.backdropwere unused, apparently not, so I also moved to SCM- variants) -D 05:16, 13 February 2021 (UTC)
Style leakage to image lightoboxes
I have looked into the issue mentioned on this thread, and found out that MediaWiki:ShowCustomModal.css targets the .modalWrapper class, which is apparently also used by image lightboxes. Nam 23:08, 14 December 2021 (UTC)
- sure. The change modifies specificity for the modalContent class, so maybe this introduces some breakage with external CSS. Alas, I won't hassle to support every possible edge case, be sure to tell me if it still works with the updated css -D 06:37, 15 December 2021 (UTC)
- I'm tempted to start using
:where()everywhere I can just to not participate in the specifity wars. Isn't 89.69% broswer support enough? lol Nam 07:46, 15 December 2021 (UTC)
- I'm tempted to start using
Prevent closing modal when clicking outside
Possible to disable closing a window by clicking outside of modal? Marvire (обговорення) 18:10, 7 January 2025 (UTC)
- Yes. You can use the
closeOnBlackoutClicksetting to control if you want the blackout to close the modal. Or define anonClosefunction that returns false to control when it should prevent closing. Or unbind the click event on the blackout directly, targeting.SCMBlackoutwith an.off('click')after instantiating the modal. -D 18:13, 7 January 2025 (UTC)- I sincerely appreciate your help) Marvire (обговорення) 18:37, 7 January 2025 (UTC)