Calcite-components: Bug: calcite-input with type="time", and clearable="false" still shows the clear button

Created on 20 Aug 2020  ·  4Comments  ·  Source: Esri/calcite-components

Summary

calcite-input with type="time", and clearable="false" still shows the clear button

image

Actual Behavior

Expected Behavior

There are use cases where we dont want the clear button for type="time"

Reproduction Steps

1.

Relevant Info

3 - installed bug

All 4 comments

Hey @kevindoshier - clearable="false" won't works since it's just a boolean, that string still gets interpreted as true.

The issue is that inside the component we are setting clearable as true for certain input types - date, time, and search, since some (not all) browsers append a clearable x button to these by default. We can remove that as a default setting for date and time, since it is not consistent between browsers (Firefox does, for example), but I think for search it should always be left on because that seems to be consistently set in default inputs with type search across browsers.

It can still of course be added to date and time by adding clearable prop should we remove it by default.

Thoughts @kevindoshier @Esri/calcite-components ?

Yeah I think at least the time input should have a way to not be clearable, at least in our scenario we dont have the concept of null time.

OK, I think removing that as a default setting from all inputs except type=search should fix for that - it'll still be possible for devs to add clearable if desired, and as mentioned seems inconsistent across browsers for native inputs.

I'll leave search as is since that one does seem to have that affordance on native input on all browsers.

That sounds great to me, thank you

Was this page helpful?
0 / 5 - 0 ratings