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

Cannot "prevent default" on a button inside the title when this row was injected thru acordion.insertAdjacentHTML #7124

Open
ferkiernan opened this issue Sep 20, 2023 · 0 comments

Comments

@ferkiernan
Copy link

ferkiernan commented Sep 20, 2023

Cannot "prevent default" on a button inside the title when de row was injected thru acordion.insertAdjacentHTML

I created a CSS class like this:

.mybuttns{
				display: table-cell; 
				width: 280px; 
				text-align: right;			
			}

Then It was applied like:

<div class="title"> Mytitle plus
    <div class="mybuttns" >
				<div class="ui tiny button">This button shouldn't open my accordion</div>
				<div class="ui tiny button" onclick="">neither this</div>
				<div class="ui tiny button" onclick="">neither this</div>		
    </div>  
</div>

Some accordion rows (understanding row as title+content) were harcoded in the html file,
others were dinamically created using an html-string, and then used: acordion.insertAdjacentHTML

On the other side I did my jquery homework:

$('.mybuttns').on('click', function(event) { 
  event.stopPropagation();
});

Expected Result

When clicking anything inside my buttons div it should not open the accordion

Actual Result

Only if the accordion itemas are loaded in the biginning this "stopPropagation" works.

When ittem is added with acordion.insertAdjacentHTML it won't trigger the event $('.mybuttns').on('click', function(event)

Version

2.4

Testcase

Let me know if do you need anything else

@ferkiernan ferkiernan changed the title Cannot "prevent default" on a button inside the title when de row was injected thru acordion.insertAdjacentHTML Cannot "prevent default" on a button inside the title when this row was injected thru acordion.insertAdjacentHTML Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant