ember-modal-dialog icon indicating copy to clipboard operation
ember-modal-dialog copied to clipboard

Odd initial positioning

Open tarponjargon opened this issue 8 years ago • 2 comments

I have installed ember-modal-dialog and am just doing some testing...there's one thing I can't figure out. I'm just wanting to open a regular centered modal, and when the modal opens, it's positioned at the bottom-right of the page. When toggled, it appears correctly.

Here's a video

My code is very simple and is based on the demo code:

{{#if isShowingModal}}
	{{#modal-dialog
		translucentOverlay=true
		close="toggleModal"
	}}
	<img src="{{images.large}}"  />
	{{/modal-dialog}}
{{/if}}

I also tried tether-dialog with the same results. When I tinker with the positioning, sometimes I am able to get it to appear in the top left. But no matter what the settings, the modal appears either bottom-right or top-left on initial load.

I'm quite sure I'm doing something wrong, I just don't know what it is! Thanks!

tarponjargon avatar Mar 11 '17 18:03 tarponjargon

it seems like it's calculating the dimensions before the image loads. Can you add width and height to the img tag? If that's not possible, perhaps try preloading the image before toggling the modal.

humanchimp avatar Mar 23 '17 23:03 humanchimp

I was experiencing this same issue. Can confirm that specifying a width / height fixed the issue for me

charlie-curtis avatar Apr 06 '17 02:04 charlie-curtis