uiv-lib/uiv

Unable to specify input width in TimePicker

Simonboeuf1 opened this issue · 3 comments

Which component

TimePicker

We should be able to use a custom width, or any custom style, for the TimePicker component and its inputs. At the moment it is not possible (if the user doesn't want to do some !important stuff), as this lines shows : https://github.com/wxsms/uiv/blob/master/src/components/timepicker/TimePicker.vue#L27

I can see 3 ways of doing it :

  • The best one imho : Just remove this hardcoded value and the style prop. Users will be able to customize it at will from outside.
  • As width is the only hardcoded style value, I guess a inputWidth prop should also do the trick. I can also see a big benefit for this one : we could have a default value at 50px that would not cause any breaking changes.
  • Provide a customInputStyle prop alllowing the user to specify any custom styles to the inputs.

@wxsms I would be happy to make a PR if you think it would be useful, and if you tell me which one of these 3 solutions you like best.

wxsms commented

Hi @Simonboeuf1 , I prefer solution 2 that use a prop. PR is welcome. Thanks.

wxsms commented

it's done, thanks.