File tree Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Expand file tree Collapse file tree 4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change 11@prefix-cls : rc- picker;
22
33.@{prefix-cls} {
4- display : inline ;
4+ display : inline-flex ;
55
66 &-panel {
77 border : 1px solid #666 ;
221221 // ======================== Input =========================
222222 &-input {
223223 position : relative ;
224- display : inline ;
224+ display : inline-flex ;
225+ width : 100% ;
226+
227+ > input {
228+ width : 100% ;
229+ }
225230 }
226231
227232 &-clear {
Original file line number Diff line number Diff line change @@ -14,7 +14,15 @@ export default () => (
1414 locale = { zhCN }
1515 picker = "week"
1616 allowClear
17+ style = { { width : 300 } }
1718 />
19+ < Picker < Moment >
20+ generateConfig = { momentGenerateConfig }
21+ locale = { zhCN }
22+ picker = "week"
23+ allowClear
24+ />
25+ < button type = "button" > 233</ button >
1826 </ div >
1927 </ div >
2028) ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import { isEqual } from './utils/dateUtil';
2525import { toArray } from './utils/miscUtil' ;
2626import PanelContext , { ContextOperationRefProps } from './PanelContext' ;
2727import { PickerMode } from './interface' ;
28- import { getDefaultFormat } from './utils/uiUtil' ;
28+ import { getDefaultFormat , getInputSize } from './utils/uiUtil' ;
2929
3030export interface PickerSharedProps < DateType > {
3131 dropdownClassName ?: string ;
@@ -433,6 +433,7 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
433433 autoFocus = { autoFocus }
434434 placeholder = { placeholder }
435435 ref = { inputRef }
436+ size = { getInputSize ( picker , formatList [ 0 ] ) }
436437 />
437438 { suffixNode }
438439 { clearNode }
Original file line number Diff line number Diff line change @@ -147,6 +147,11 @@ export function getDefaultFormat(
147147 return mergedFormat ;
148148}
149149
150+ export function getInputSize ( picker : PickerMode | undefined , format : string ) {
151+ const defaultSize = picker === 'time' ? 9 : 11 ;
152+ return Math . max ( defaultSize , format . length + 2 ) ;
153+ }
154+
150155// ====================== Mode ======================
151156const getYearNextMode = ( next : PanelMode ) : PanelMode => {
152157 if ( next === 'month' || next === 'date' ) {
You can’t perform that action at this time.
0 commit comments