Blazorise icon indicating copy to clipboard operation
Blazorise copied to clipboard

Autocomplete: allow modification/styling of underlying TextEdit-control

Open WolfgangKluge opened this issue 3 years ago • 8 comments

Is your feature request related to a problem? Please describe. I want to set some properties on the underlying control but there's no direct access to it. E.g. I want to set Plaintext (or the class name form-control-plaintext) to the autocomplete control.

Describe the solution you'd like At least, one should be able to add css class names to the TextEdit-control.. (I can't think of a clean solution, but full control over the template would be even better - and that's true for really every control)

WolfgangKluge avatar May 23 '22 13:05 WolfgangKluge

In FreeTyping-mode, I'd like to set MaxLength, too

WolfgangKluge avatar May 23 '22 17:05 WolfgangKluge

I think some of the parameters would make sense to pass onto the TextEdit. Like Class and Style. With the prefix Search.

  • SearchClass
  • SearchStyle

Or do you have a better naming in mind?

stsrki avatar May 24 '22 05:05 stsrki

Not really. Ideally, there's a generalized way to modify all the properties of all the inner controls (not only the ones for that are variables passed through). Not sure if it's worth it - but would be great :)

In that special case I'd like to change the TextRole, too (so now 3 properties to pass through - or two and I handle that with class or style)..

WolfgangKluge avatar May 24 '22 14:05 WolfgangKluge

It's difficult to know to which subcomponent the parameter should be applied. That's why it is better to have them explicitly defined.

stsrki avatar May 24 '22 14:05 stsrki

Yeah, but having every (more or less useful) part customizable would't be feasible, too. So I have to hope that you will extend it the way I need.

WolfgangKluge avatar May 24 '22 20:05 WolfgangKluge

It's difficult to know to which subcomponent the parameter should be applied. That's why it is better to have them explicitly defined.

We did do an options based api on the ModalProvider, which you were thinking in making it more generic somehow, maybe we can figure out a way to do this component options api that bubbles down to the simpler component when we're talking about a composite components like Autocomplete, instead of having to duplicate every single parameter we want to bubble down.

David-Moreira avatar May 24 '22 20:05 David-Moreira

It's difficult to know to which subcomponent the parameter should be applied. That's why it is better to have them explicitly defined.

We did do an options based api on the ModalProvider, which you were thinking in making it more generic somehow, maybe we can figure out a way to do this component options api that bubbles down to the simpler component when we're talking about a composite components like Autocomplete, instead of having to duplicate every single parameter we want to bubble down.

That's a different use case. And the additional options would be defined through the single options parameter. But we would still need to manually define every possible attribute.

stsrki avatar May 25 '22 05:05 stsrki

It's difficult to know to which subcomponent the parameter should be applied. That's why it is better to have them explicitly defined.

We did do an options based api on the ModalProvider, which you were thinking in making it more generic somehow, maybe we can figure out a way to do this component options api that bubbles down to the simpler component when we're talking about a composite components like Autocomplete, instead of having to duplicate every single parameter we want to bubble down.

That's a different use case. And the additional options would be defined through the single options parameter. But we would still need to manually define every possible attribute.

Not exaclty a different use case, I mean smthg like this. BaseOptions : Every base component parameter options TextEditOptions : BaseOptions Every textEdit specific options

And then you could just use TextEditOptions on every composite component that uses TextEdit, maybe even with some kind of smart helper that'd just to all that mapping.

But yes, most implementations will require manual mapping I guess. But we can always borrow source generators for creating most of the repetitive stuff I guess.

Or I'm sure we can think of other ways with some kind of fluent mapping options, etc

In theory this wouldn't be so bad, need to find an elegant way to implement this or something similar.

David-Moreira avatar May 25 '22 19:05 David-Moreira

I would apprecheate this, since I would like to modify styling of the textedit (color, etc.).

NeoCoderMatrix86 avatar Oct 12 '22 09:10 NeoCoderMatrix86

I agree, I am using the AutoComplete styling but the font size is locked to that defined by the Bootstrap class form-control, whereas I need to change mine to be consistent with the rest of the form I am using it on.

Please can we get a parameter for styling the Input component that this wraps. A property called InputStyle would be fine.

MarcusBullock avatar May 10 '23 16:05 MarcusBullock

is there any update on this please?

there is currently no way to customise font size on the Autocomplete form unless I am missing something.

MarcusBullock avatar Oct 12 '23 16:10 MarcusBullock

I can confirm it is still possible. We will add it in the 1.4 milestone.

stsrki avatar Oct 12 '23 16:10 stsrki

I think some of the parameters would make sense to pass onto the TextEdit. Like Class and Style. With the prefix Search.

  • SearchClass
  • SearchStyle

Or do you have a better naming in mind?

@steal4life Do it like this.

stsrki avatar Oct 12 '23 16:10 stsrki