How to make dialog2 resizable dynamically

Hi, I want to make my dialog2 be resizable like html tag textarea

so I added the Style as the following on dialog2:

<button id="dialog-show-button" class="aui-button">show</button>

<section id="demo-dialog" class="aui-dialog2 aui-dialog2-small aui-layer" role="dialog" aria-hidden="true" style="resize: both;overflow: auto;">
<header class="aui-dialog2-header">
<h2 class="aui-dialog2-header-main">test</h2>
<a class="aui-dialog2-header-close">
<span class="aui-icon aui-icon-small aui-iconfont-close-dialog">Close</span>
<div class="aui-dialog2-content">
<footer class="aui-dialog2-footer">
<div class="aui-dialog2-footer-actions">
<button id="dialog-submit-button" class="aui-button aui-button-primary">ok</button>

but I got this:


here is my code on JS Bin.

need your help and suggestions,

thank you.

1 answer

1 accepted

Hi @Hao,

The CSS "resize" property only applies to form input elements, so it won't help you change the size of the dialog element dynamically.

You've currently got the `aui-dialog2-small` CSS class on the dialog. If you want it to be larger, you could change that to `aui-dialog2-xlarge`; check the "HTML Attributes" section of Dialog2's documentation for the valid CSS class values you can add to change the dialog's size.

The preset sizes for dialog2 will automatically resize with the browser as it shrinks in size; this allows them to work on mobile devices like iPads.

If what you really want to do is make the dialog take up most of the browser's width and height, you could first remove the `aui-dialog2-xyz` size class, then create your own that does something similar, using either CSS calc or fixed positioning to determine the appropriate size to render at. I don't recommend this, as it will be susceptible to breaking if and when either Jira or AUI make design changes.

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,323 views 14 20
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