Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

Sliders sometimes won't appear in modals #244

Closed
killvn opened this issue Nov 25, 2017 · 3 comments
Closed

Sliders sometimes won't appear in modals #244

killvn opened this issue Nov 25, 2017 · 3 comments
Labels

Comments

@killvn
Copy link

killvn commented Nov 25, 2017

Have a problem, I used to turn up for a slider widget:

When pressing on button first, slider Widgets do not appear
Then close the pop up and open the back, slider widgets appear.
Here is my html templates on habpanel :

<script type="text/ng-template" id="myModalContent.html">
    <div class="container" style="padding: 30px; border: 1px solid #456;">
      <a ng-click="$close()" class="pull-right btn btn-danger">X</a>
      <h3 style="color: white">All Lights</h3>
<div ng-init="TretKitchenDenTranLightLevel = {
                       	'item': 'TretKitchenDenTranLightLevel',
                        'floor': 0,
                        'ceil': 100,
                        'step': 0,
                        'precision': 1,
						'unit': '%',
                    		}">
</div>
<widget-slider ng-model="TretKitchenDenTranLightLevel">
    </div>
</script>
<button class="btn btn-default btn-lg"
        ng-click="openModal('myModalContent.html', true, 'lg')">
  Open Modal
</button>

This is my description video : https://drive.google.com/file/d/1gUMvG1eQoUnNRyZ74XlH3hHCY_IMAX5O/view?usp=sharing
This issue when using the slider, other content works well.

@ghys
Copy link
Member

ghys commented Nov 27, 2017

It seems like race condtion - after displaying the popup an update event is broadcasted, making the slider appear, but on the first time the popup is invoked it's sent before the slider has finished loading, therefore it doesn't receive it. I tried a few things trying to fix it, without success for now. This is related to #214.

@ghys ghys added the bug label Nov 27, 2017
@ghys ghys changed the title popup issue Sliders sometimes won't appear in modals Nov 27, 2017
@killvn
Copy link
Author

killvn commented Nov 27, 2017

I have asked this issue from angular slider and instruction fixes : https://github.com/angular-slider/angularjs-slider#my-slider-is-not-rendered-correctly-on-load
but I don’t know what to edit this code in openhab.

@ghys
Copy link
Member

ghys commented Nov 27, 2017

Yes, I tried that before but it caused other problems - the dimensions are not always right so the slider wouldn't appear correctly.
It is actually done already when handling the update event I referred to above.

https://github.com/openhab/org.openhab.ui.habpanel/blob/master/web/app/dashboard/dashboard.view.controller.js#L32...L38

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

No branches or pull requests

2 participants