Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getbootstrap.com/docs/ - Documentation for 'Modal' Dialog 'Via JavaScript' section lacks viable examples #39135

Open
3 tasks done
YoloClin opened this issue Sep 1, 2023 · 0 comments

Comments

@YoloClin
Copy link

YoloClin commented Sep 1, 2023

Prerequisites

Describe the issue

Note: This is about documentation, rather than bootstrap core. I cannot find a repo for getbootstrap.com directly.

The 'usage' section of Modal documentation ( https://getbootstrap.com/docs/5.3/components/modal/#usage ) discusses how to toggle and dismiss modals, the examples result in an action occurring (e.g., the modal is shown, toggled etc)

The following section, 'Via JavaScript' ( https://getbootstrap.com/docs/5.3/components/modal/#via-javascript ) discusses how to obtain a Modal object reference but contains no actionable samples - it took me a while to realize that the subsequent 'methods' section exposed how to actually show a dialog.

I think that replacing the code block within 'Via Javascript' from

const myModal = new bootstrap.Modal(document.getElementById('myModal'), options)
// or
const myModalAlternative = new bootstrap.Modal('#myModal', options)

To:

const myModal = new bootstrap.Modal(document.getElementById('myModal'), options)
// or
const myModalAlternative = new bootstrap.Modal('#myModal', options)
// Show a dialog, see 'Methods' for more JavaScript functionality
myModal.show();

Would make a lot of sense from a reader point of view, particularly as the 'Options' and 'Methods' sections are at the same h3 heading depth as the javascript section (I can understand why, but I assumed they were unrelated documentation to what I was after).

Reduced test cases

As above, documentation change only.

What operating system(s) are you seeing the problem on?

Linux

What browser(s) are you seeing the problem on?

No response

What version of Bootstrap are you using?

5.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants