Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Fluent UI Blazor #30

Open
mortenfa opened this issue Mar 23, 2024 · 3 comments
Open

Fluent UI Blazor #30

mortenfa opened this issue Mar 23, 2024 · 3 comments

Comments

@mortenfa
Copy link

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!

@SteveSandersonMS
Copy link
Contributor

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!

@mortenfa
Copy link
Author

mortenfa commented Mar 27, 2024

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 = ""
},
]
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

@wisamidris7
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants