dialog2 + aui-select, problem with aria-hidde Edited

Hi, I'm trying to use jQuery change event for aui-select, here is my code:

myjiraplugin.vm:

$webResourceManager.requireResource("com.atlassian.auiplugin:dialog2")
$webResourceManager.requireResource("com.atlassian.auiplugin:aui-select")
<script type="text/javascript">
#include("js/myjiraplugin.js")
</script>

<button id="test-button" class="aui-button">Show dialog</button>
<section id="test-dialog" class="aui-dialog2 aui-dialog2-small aui-layer" aria-hidden="true">
<header class="aui-dialog2-header">
</header>
<div class="aui-dialog2-content">
<form class="aui">
<aui-select id="test-select" name="test-select" placeholder="Select..">
<aui-option id="yes">yes</aui-option>
<aui-option id="no">no</aui-option>
</aui-select>
</form>
</div>
<footer class="aui-dialog2-footer">
</footer>
</section>

myjiraplugin.js:

AJS.$(document).ready(function() {
AJS.$("#test-button").click(function(e) {
e.preventDefault();
AJS.dialog2("#test-dialog").show();
});

AJS.$("#test-select").change(function(e) {
console.log(e);
});
});

 the problem is that console always show 3 times outputs, but the aui-select just has been changed only once:

showlog.png

If I remove aria-hidde attribute from section tag, that will show just one output as normal, but can't get dialog box/popup window effect...

Did I miss something here?

Regards,

1 answer

Hi @Hao,

I noticed in your screenshot that the three events that get logged are about 1-2 seconds apart... Are you saying that they are all fired in response to a single user interaction?

I created a reduced test case for this problem, but I cannot seem to reproduce it using only AUI 6.0.0: https://codepen.io/chrisdarroch/pen/RxaxRv

In what browser(s) are you experiencing this problem? Does this problem also occur for you in the test case I provided, or only when testing in Jira? What version of Jira are you testing in?

Cheers,
Daz

Hi @Chris "Daz" Darroch, thank you so much for responding.

  • Are you saying that they are all fired in response to a single user interaction?
    Yes.
  • In what browser(s) are you experiencing this problem?  
    Google Chrome Versión 63.0.3239.84 (Build oficial) (64 bits)
  • Does this problem also occur for you in the test case I provided, or only when testing in Jira? 
    It's only happening in JIRA, works well in CODEPEN Test...
  • What version of Jira are you testing in?
    <jira.version>7.2.2</jira.version>


In this moment, I just use AUI Select2 without applying the multiple="" attribute for instead, and doesn't occurs problem.


Sincerely,

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,147 views 13 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot