Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Got the problem about "popup" window #19

Open
liulian1004 opened this issue May 16, 2022 · 2 comments
Open

Got the problem about "popup" window #19

liulian1004 opened this issue May 16, 2022 · 2 comments

Comments

@liulian1004
Copy link

Hi, I follow the tutorial and blocking on the popup window step.
I completely copy the code of ProductList.razor to avoid any typos and still can't pop up the window when click "More Info".
I have switched different browser, and make sure the browser did not block the popup window.
And of course there is no error message.
Furthermore, my main layout is different as the tutorials'. On my side, the main page only display one line with one product. I don't have serval products displayed in one line as showed in the YouTube.
I am bit of doubt about bootstrap version problem? I use 5.1.3.

Let me know, thanks.

@gabrielpereira3
Copy link

gabrielpereira3 commented Jul 19, 2022

About the popup problem, you will have to make 3 changes:

Replace the data-toggle, data-target and data-dismiss to data-bs-toggle, data-bs-target and data-bs-dismiss

So, these lines
<button @onclick="(e => SelectProduct(product.Id))" data-toggle="modal" data-target="#productModal" class="btn btn-primary">More Info</button>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button>

will be like that
<button @onclick="(e => SelectProduct(product.Id))" data-bs-toggle="modal" data-bs-target="#productModal" class="btn btn-primary">More Info</button>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button>

And about the one line product issue:

Try replacing the line <div class="card-columns"> to <div class="card-columns row row-cols-3 row-cols-md-3 row-cols-sm-2 g-4">
It worked for me, my page was displaying one line with only one product too.

@l122
Copy link

l122 commented Mar 26, 2023

@liulian1004, thank you for bringing up this issue, because I had exactly the same one.
@gabrielpereira3, thank you for the solution and saving me a ton of time ;)

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

No branches or pull requests

3 participants