简体   繁体   中英

How to prevent underline and slash symbols in material-ui/pickers?

The material ui pickers for version mui version 4 shows underline and slash characters to separate day, month, year. Is there a way to remove those?

<KeyboardDatePicker
   margin="normal"
   id="date-picker-dialog"
   label="Date picker dialog"
   format="MM/dd/yyyy"
   value={selectedDate}
   onChange={handleDateChange}
   KeyboardButtonProps={{
   "aria-label": "change date",
     disableUnderline: true
   }}
   InputProps={{
     disableUnderline: true
   }}
/>

Searched the docs but haven't found anything useful which would prevent that.

Sandbox demo

<KeyboardDatePicker
   margin="normal"
   id="date-picker-dialog"
   label="Date picker dialog"
   format="MMddyyyy"
   value={selectedDate}
   onChange={handleDateChange}
   maskChar=" "
/>

Adding maskChar attribute will solve your issue

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM