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

Tab created with Event.cs does not work on Mobile. #622

Closed
munkerjs opened this issue Feb 6, 2023 · 12 comments
Closed

Tab created with Event.cs does not work on Mobile. #622

munkerjs opened this issue Feb 6, 2023 · 12 comments
Assignees
Labels
Milestone

Comments

@munkerjs
Copy link

munkerjs commented Feb 6, 2023

Describe the bug
if (tabStripName == "pd-tabs") { var entityId = ((EntityModelBase)eventMessage.Model).Id; var price = ((ProductDetailsModel)eventMessage.Model).Price.FinalPrice; await eventMessage.TabFactory.InsertAfterAsync("pd-reviews", builder => builder .Text("Taksit Seçenekleri") .Name("pd-tab-installment") .Icon("fas fa-credit-card", "fas") .LinkHtmlAttributes(new { data_tab_name = "Installment" }) .Action("ProductInstallmentTab", "CreditCardWeb", new { productId = entityId, priceAmount = price.Amount }) .Ajax()); }

Note: This code is taken from the document.
Document Link: https://smartstore.gitbook.io/developer-guide/compose/modules/examples/adding-tabs

With this code, we add a tab to the product detail section. It works fine on desktop but not on mobile.

To Reproduce
Steps to reproduce the behavior:

  1. Enter any product detail page.
  2. When you view it from the desktop, the tab will be visible.
  3. It works when clicked. (Image This: https://prnt.sc/CSefyUuR2Ja7 )
  4. When you switch to the mobile version, it does not work when clicking the tab. (https://prnt.sc/mgKCTmSFruSN)
  5. See error

Expected behavior
The tab is expected to work in Desktop and Mobile versions.

Screenshots

  1. Desktop => https://prnt.sc/CSefyUuR2Ja7
  2. Mobile => https://prnt.sc/o4HlHkittFsx
  3. Error => https://prnt.sc/mgKCTmSFruSN

Desktop (please complete the following information):

  • OS: [e.g. Windows 10 x64]
  • Browser [e.g. chrome, safari]

Additional context
The problem exists in versions 5.2 and 5.3.

@Michael-Herzog
Copy link
Contributor

Michael-Herzog commented Feb 7, 2023

Be sure your returned content looks something like this:

<h5 aria-expanded="false" class="nav-toggler collapsed" data-target="#collapse-my-tab" data-toggle="collapse">
Tab title
</h5>

<div class="nav-collapse collapse show" id="collapse-my-tab">
Real content
</div>

Regards

@munkerjs
Copy link
Author

munkerjs commented Feb 8, 2023

As you said, we get returns. But the content is empty.

@Michael-Herzog
Copy link
Contributor

Have you pulled the latest code containing my commit?

@Michael-Herzog
Copy link
Contributor

Add the class show to nav-collapse.

@munkerjs
Copy link
Author

munkerjs commented Feb 8, 2023

Add the class show to nav-collapse.

I don't understand where to install it?

Code Here: https://prnt.sc/vd8_UETukzE1

@Michael-Herzog
Copy link
Contributor

Look at the div in the code I've posted above.

@munkerjs
Copy link
Author

munkerjs commented Feb 8, 2023

When clicked once on mobile, the content appears, but the tab does not close again.

@Michael-Herzog
Copy link
Contributor

Can you please upload this somewhere so I can have a direct look.

@munkerjs
Copy link
Author

munkerjs commented Feb 9, 2023

Can you give me your e-mail address? I would like to forward the module file privately to you.

@Michael-Herzog
Copy link
Contributor

Send the link to info[at]smartstore.com

@Michael-Herzog
Copy link
Contributor

I just checked your plugin. The code I've posted above is completely missing in the view ProductInstallmentTab.cshtml. Just wrap it around thecontent you're returning.

<h5 aria-expanded="false" class="nav-toggler collapsed" data-target="#collapse-my-tab" data-toggle="collapse">
Tab title
</h5>

<div class="nav-collapse collapse show" id="collapse-my-tab">
<div class="row mt-2" id="installment-table">
...
</div>
</div>

@munkerjs
Copy link
Author

munkerjs commented Feb 9, 2023

Thanks, I solved the problem!

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

No branches or pull requests

3 participants