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

Add default value for SearchBar component

Open tonai opened this issue 1 year ago • 4 comments

It would be great to have the ability to set a default value for the SearchBar component without having to redeclare the whole input using the renderInput props.

I will propose a PR to add an additional defaultValue props.

tonai avatar Feb 13 '25 16:02 tonai

I proposed a PR but in fact I am wondering, why not proposing an inputProps props like the Input component ?

tonai avatar Feb 21 '25 15:02 tonai

We could also maybe do the same for the button, for example it is not possible now to disable the Searchbar (or maybe you prefer a disabled attribute ?).

tonai avatar Feb 21 '25 15:02 tonai

@tonai I agree, we could have an inputProps:InputProps and a submitButtonProps:ButtonProps props. Are you working on this?

enguerranws avatar Mar 03 '25 11:03 enguerranws

@enguerranws in fact I created a PR to manage the defaultValue part and afterwards I realized that we could go further and wanted to start the discussion about inputProps. The first PR has been merged, so we now have defaultValue, but we could still propose a new one for inputProps and submitButtonProps. For now I didn't start anything because I wasn't sure it was the right thing to do.

tonai avatar Mar 05 '25 14:03 tonai