googlearchive / paper-dialog

A dialog à la Material Design
19 stars 16 forks source link

Sizing of "scroller" incorrect on dialogs with paper-checkbox #38

Open mwinters-stuff opened 9 years ago

mwinters-stuff commented 9 years ago

try

<paper-action-dialog id="edit_node_dialog" heading="{{dialogNode.id == null ? 'New' : 'Edit'}} Node" transition="paper-transition-center" layered="false">
      <div id="edit_form" layout vertical>

        <paper-input-decorator  label="Location" floatingLabel>
          <input is="core-input" id="input_node_location" value="{{dialogNode.location}}" required></input>
        </paper-input-decorator>

        <paper-input-decorator  label="Number" floatingLabel>
          <input is="core-input" id="input_node_number" value="{{dialogNode.number}}" required type="number" on-key-press="{{keyPress}}"></input>
        </paper-input-decorator>

        <paper-checkbox id="input_node_offline" label="Offline" checked="{{dialogNode.offline}}"></paper-checkbox>
        <paper-checkbox id="input_node_calcdewpoint" label="Calc Dew Point" checked="{{dialogNode.calcDewPoint}}"></paper-checkbox>
      </div>
      <paper-button dismissive>Cancel</paper-button>
      <paper-button id="buttonOk" affirmative on-tap="{{nodeButtonOkTapped}}">Ok</paper-button>
    </paper-action-dialog>

and this should nicely show the dialog, without scrollbars, as it is small, but we get scrollbars in the scroller div.

mwinters-stuff commented 9 years ago

One of our devs has found that wrapping the paper-checkbox in div tags, then the dialog sizes correctly.

morethanreal commented 9 years ago

I'm not sure why wrapping the checkbox in a div works (it doesn't seem to work for me), but it seems like the cause is because there's a sized paper-ripple that overflows the paper-checkbox, somehow the platform calculates the scroll height differently than the natural height used to size the scroller. You can add some bottom padding to #edit_form to pre allocate some space for the ripple.

ghost commented 9 years ago

+1 same issue, also wrapping checkbox with div does not help.