kendo-react icon indicating copy to clipboard operation
kendo-react copied to clipboard

feat: control the floating labels position of form components

Open kspeyanski opened this issue 5 years ago • 2 comments

The feature has been requested by a client in a support ticket. (ticket id: 1422821)

This is needed to avoid having to define the labels by yourself and apply the same classNames as our components.

We accept proposals for the property's name, i'm currently thinking of labelFloat which will be of type boolean. Since there's no reason to want the label to stay in the input, the only valid scenario is for it to stay on the top, thus setting the labelFloat to false will disable its floating behavior and always keep it on top.

kspeyanski avatar Aug 12 '19 06:08 kspeyanski

Should be included in the forms spec: https://github.com/telerik/k2/issues/139

vladimirivanoviliev avatar Aug 12 '19 07:08 vladimirivanoviliev

Until a built-in feature is added, there is an easy solution for making the floating labels be static by adding a className to the FormElement and removing the offset of the floating labels: https://stackblitz.com/edit/react-fdtufq?file=app%2Fmain.jsx,index.html

        <FormElement
          className={'unfloat-labels'}
            <style>
            .unfloat-labels .k-floating-label-container.k-empty > .k-label{
                top: 0px;
                left: 0px;
                pointer-events: all;  
            }

kdikov82 avatar Jul 31 '22 10:07 kdikov82