fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

How can I interact with SearchBox on CommandBar

Open wellbeck190 opened this issue 9 years ago • 16 comments

I see in documentation have isSearchBoxVisible and searchPlaceholderText property to display it on CommandBar, but I don't know any way to get its value or interact with it. Help me, Thanks!

wellbeck190 avatar May 16 '17 09:05 wellbeck190

Right now the searchbox in the command bar is pretty useless. I'm working on a PR right now to revamp the entire command bar, including integrating the SearchBox component and passing searchBoxProps to it. This will let you do anything with the CommandBar SearchBox that you can do with the search box component.

micahgodbolt avatar May 22 '17 18:05 micahgodbolt

Add an event listener to the search box element.

jcoleman-pcprofessional avatar Jun 15 '17 02:06 jcoleman-pcprofessional

@micahgodbolt any idea when this fix will be released? Cheers

chriswbarrett avatar Jun 22 '17 00:06 chriswbarrett

Noticed this as well - very useless without having an onchanged event for the searchbox. Right now I'm adding my own search box to the commandbar instead.

wobba avatar Oct 18 '17 07:10 wobba

I worked around it by wrapping the component then doing an componentWillMount that attaches a native event onchange handler

chriswbarrett avatar Oct 18 '17 18:10 chriswbarrett

@micahgodbolt any eta on this or do you want some help with something?

vertonghenb avatar Oct 18 '17 22:10 vertonghenb

Sorry about the crazy long delay. @vertonghenb, I just just opened a PR to move the new command bar into Fabric. If you are able to take a look at it, try it out, give a thumbs up, it'll make the PR go faster.

You can either pull down my branch and try it there, or you can add @uifabric/experiments as a dependency and import the commandBar from there, to try it in your product.

micahgodbolt avatar Oct 19 '17 15:10 micahgodbolt

@micahgodbolt Thanks for the update, can't seem to find the PR though?

vertonghenb avatar Oct 24 '17 00:10 vertonghenb

@vertonghenb it was already merged into our 6.0 branch. we should be pushing out beta releases soon

micahgodbolt avatar Oct 24 '17 03:10 micahgodbolt

@micahgodbolt when v6.0 will be a stable release? Thanks

jonathanhotono avatar Mar 28 '18 10:03 jonathanhotono

@jonathanhotono v6 has been pulled, the latest is now v5.7. So not sure what will happen with this particular feature.

wobba avatar Mar 28 '18 13:03 wobba

This issue has been automatically marked as stale because it has not activity for 30 days. It will be closed if no further activity occurs within 14 days of this comment. Thank you for your contributions to Fabric React! Why am I receiving this notification?

stale[bot] avatar May 27 '18 14:05 stale[bot]

I could really use this. I hope it stays in 6.0 at least.

aappddeevv avatar May 30 '18 22:05 aappddeevv

It's quite easy to add the search box component manually as well.

wobba avatar May 31 '18 05:05 wobba

You can use an item's onRender to add any component you want. Might require a little styling to make it fit properly, but that's pretty straight forward as well.

https://codepen.io/micahgodbolt/pen/zaGwee?editors=1010

micahgodbolt avatar May 31 '18 16:05 micahgodbolt

Closing this issue as we now have a straightforward way to add a fully functional searchbox to the current release of Fabric.

micahgodbolt avatar May 31 '18 16:05 micahgodbolt