fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Expose css class properties on input element of search box.

Open nipunja opened this issue 9 years ago • 4 comments

We are hosting search box on top of panel. Our requirement is to move focus on search box when panel loads. The panel supports firstFocusableSelector props which expects a class name of a focusable element. However, we cannot use this property as search box does not allow you to give input class names.

nipunja avatar Aug 14 '17 10:08 nipunja

firstFocusSelector is just a string that gets prepended with a period. So you can pass in a custom parent selector + the classname on the input.

https://codepen.io/micahgodbolt/pen/wqryaW

micahgodbolt avatar Aug 14 '17 16:08 micahgodbolt

@micahgodbolt Is it ok to take dependency on "ms-SearchBox-field" on input (reference). I thought "ms-SearchBox-field" class name can be changed and it is not safe to take dependency on office fabric internal class names.

nipunja avatar Aug 17 '17 05:08 nipunja

I don't think we could ever realistically get rid of those class names. The main thing we want to discourage is using class names to apply styles.

micahgodbolt avatar Aug 17 '17 15:08 micahgodbolt

Closing since question has been answered, please reply if any issues remain

erichdev avatar Oct 17 '17 00:10 erichdev