fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

TextFied label on side

Open manlamcheng opened this issue 6 years ago • 6 comments

Describe the feature that you would like added

What component or utility would this be added to

Have you discussed this feature with our team, and if so, who

Additional context/screenshots

manlamcheng avatar Mar 28 '20 16:03 manlamcheng

the default label of the Textfield is on the top of the input, is there a setting or custom style that can move it to the left hand side of the textbox? (underlined prop can move it to the side, but doesn't show the input as a textbox)

Thank you !

manlamcheng avatar Mar 28 '20 16:03 manlamcheng

@manlamcheng Please fill out the template fully to give us the complete picture of your scenario. I believe you can use onRenderLabel to provide a "custom renderer for the label. If you don't call defaultRender, ensure that you give your custom-rendered label an id and that you set the textfield's aria-labelledby prop to that id." https://developer.microsoft.com/en-us/fluentui#/controls/web/textfield

aneeshack4 avatar Mar 30 '20 20:03 aneeshack4

Thanks for taking the time to enter an issue. However, it seems that there aren't enough details here for this issue to be actionable.

When issues are created, we need details such as:

  1. Which Fabric component and which version of the Fabric component is causing the issue
  2. What behaviors and attributes are missing or incorrect
  3. What you expected and what is actually happening
  4. Confirmation that the problem reproduces in isolation

Without a clear understanding of these details, it's not possible to take clear action on issues. We are unable to meet your expectations, properly address the root cause, and make changes without affecting the expectations of other consumers.

Please provide these additional details as you are able. The default issue template provides an outline of these details and is viewable when creating a new issue. Additionally, if this is an accessibility issue, please see Accessibility Troubleshooting in our wiki for more guidance. If these details cannot be provided, please kindly close the bug.

Thank you for your patience.

msft-github-bot avatar Mar 30 '20 20:03 msft-github-bot

Hello, sorry for the late response

it's not a issue but rather a feature/setting that I think it should have

  1. Which Fabric component and which version of the Fabric component is causing the issue https://developer.microsoft.com/en-us/fluentui#/controls/web/textfield

  2. What behaviors and attributes are missing or incorrect from all the sample code on the above page, the label are all on top of the text box, except the one for Underlined and borderless TextFields. the label is on the left side of the text box. I was expecting that it should have a attribute that can change the label position, something like: labelPosition: top/left/right. because it's very common for user to want to put label differently on the same form. so it should be easy to change.

Perhaps onRenderLabel as you suggested above may help, I haven't tried it yet. maybe you can provide some code example ?

Thank you !!

manlamcheng avatar Apr 01 '20 14:04 manlamcheng

@manlamcheng It seems that we do have labelPosition on some components like SpinButton. I think it's a reasonable ask to add it to TextField so I'll add this to the backlog for review. For now, I'd suggest using our Position utility - see how SpinButton uses Position.button to handle this. The styles.ts file has the exact css for positioning the label start, end, top, bottom.

aneeshack4 avatar Apr 01 '20 19:04 aneeshack4

Thank you very much !

manlamcheng avatar Apr 02 '20 17:04 manlamcheng