smartcomponents icon indicating copy to clipboard operation
smartcomponents copied to clipboard

Fluent UI Blazor

Open mortenfa opened this issue 1 year ago • 3 comments

What a great idea! Thumbs up to this. :)

I've already tried it out with success (primarily SmartPaste) in different scenarios (Blazor, MVC,) but I'm stuck in Blazor when using Fluent UI (.Net 8). It would be great if it was possible to override the submit event of the Smart Paste button so I could manipulate the payload data before posting. Just a thought.

Thanks!

mortenfa avatar Mar 23 '24 22:03 mortenfa

It would be great if it was possible to override the submit event of the Smart Paste button so I could manipulate the payload data before posting.

Can you provide an example of how you'd want the API to look? I'm unusure in what way you'd want to "manipulate the payload data". Thanks!

SteveSandersonMS avatar Mar 27 '24 10:03 SteveSandersonMS

Some ideas, I didn't mean to intercept the pasted data, but more in the likes of adding configuration options to the button:

In Blazor Fluent UI, the components wraps a corresponding element with a "current-value" property for example

<fluent-text-area current-value="<paste text here>"></fluent-text-area> <fluent-select current-value="<paste text here>"></select>

The "traditional" Form controls (Text field, radio, checkbox and textarea) have a Name attribute where as the combobox, select, autocomplete and more are implemented as components without the Name attribute - but there is a Title (aria-title)

So if the component could search for these as well and insert the results in the current-value property I suppose it would work.

Never the less it could be nice with a config object setting the elements to look for. var config = [ { Type = "<HTML,, Blazor, Blazor Fluent UI, MVC, etc.. ", FieldType = "select, textfield, combobox etc." Name = "<Fieldname>" }, ] If for example Name is 'Select1', FieldType is 'select' and the Type is 'Blazor Fluent UI' then the backing code knows that it should look for a '' tag with the aria-title 'Select1' (or name attribute if it's a text field / textarea) and set the value in the "current-value" property

mortenfa avatar Mar 27 '24 11:03 mortenfa

you can make your own aspnetcomponents library with using fluent js it could work

wisamidris7 avatar Jun 02 '24 13:06 wisamidris7