ng2-ui / datetime-picker

Angular2 DateTime Picker
https://ng2-ui.github.io/#/datetime-picker
MIT License
121 stars 62 forks source link

md-input closes the picker when the input gets focused #100

Closed vinagreti closed 7 years ago

vinagreti commented 7 years ago

When using Material2 <md-input> the picker is closed just after I click the field because the field gets focused and then the picker closes because it looses the focus. A workaround is disable the field, so it doesn't gets focused and then the picker doesn't close. But than I do this, I need to click at the bottom line beyond the field to open the picker. Are you planning to support material field?

See my code using disabled

        <md-input 
        [(ngModel)]="sample.shipment_date" 
        ngControl="shipment_date" 
        name="shipment_date" 
        type="text" 
        placeholder="Shipment date" 
        [disabled]="true"
        ng2-datetime-picker
        date-format="DD/MM/YYYY hh:mm:ss"
        year="2014"
        month="12"
        day="31"
        hour="23"
        minute='59'
        close-on-select="true"
        ></md-input>
allenhwkim commented 7 years ago

I may add another feature to open datetime picker from any element including input field. For an example,

<input [(ngModel)]="myDate" />
<span class="glyphicon glyphicon-calendar" 
  ng2-datetime-picker 
  (valueChanged)="myDate=$event"></span>
vinagreti commented 7 years ago

Do you have any deadline for this?

allenhwkim commented 7 years ago

Just a plan at this moment