bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Disable input text but not disable calendar?

Open xingped opened this issue 9 years ago • 4 comments
trafficstars

Bug description:

Is there or can we have a way to disable the input text box but still allow the calendar to work? Currently if the input text is disabled, it disables the whole calendar, but really I just want to prevent users from typing in the date box.

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/c53OivUuETsY9eN7AE5V?p=preview

Version of Angular, UIBS, and Bootstrap

Angular: 1.5.8

UIBS: 2.1.3

Bootstrap: 3.3.7

xingped avatar Oct 05 '16 20:10 xingped

A dirty workaround plunker http://plnkr.co/edit/QzPLG3SbEIkVEbNAE0BZ?p=preview

roger2hk avatar Oct 06 '16 08:10 roger2hk

We actually do this at my workplace, but what we did was use a modal to open the datepicker and not use the datepicker-popup component. That would be an adequate workaround.

As for this, I can see this being a reasonable feature, and would be willing to accept a PR for this. It should be exposed through config though as an attribute on the popup directive.

wesleycho avatar Oct 13 '16 13:10 wesleycho

I'm using this as workaround:

<input
  type="text"
  uib-datepicker-popup
  is-open="isOpen"
  ng-keydown="$event.preventDefault(); isOpen = true;"
/>

waliurjs avatar Dec 09 '18 10:12 waliurjs

you can use ng-readonly="true" that will work for you

<input type="text" class="form-control" uib-datepicker-popup="{{format}}" ng-model="dtSale" is-open="popup1.opened" datepicker-options="dateOptionsForEndDate" ng-change="CompareDate()" ng-required="true" close-text="Close" alt-input-formats="altInputFormats" ng-readonly="true"/>

pritam16mgupta avatar May 10 '19 07:05 pritam16mgupta