Code Monkey home page Code Monkey logo

Comments (5)

vnbaaij avatar vnbaaij commented on July 4, 2024

There is no ready to run reproduction code provided. Please supply us with reproduction code in the form of a project or repository.

We do not have capacity to craft or compose a reproduction for every issue that gets raised.

If no code or repository is provided, this issue will get closed automatically in 3 days

Help us to help you. Thanks

from fluentui-blazor.

miszelek avatar miszelek commented on July 4, 2024

ReproBlazorFluentUI.zip

Included a repro solution. Index.razor contains sample code above.
Change the FluentUI Components version to 4.7.2 to see the described issue.

If you need more info, please let me know. Thanks.

from fluentui-blazor.

vnbaaij avatar vnbaaij commented on July 4, 2024

I can't find what commit would have caused this behavior to change. In your (Bootstrap based) demo, removing the Tab works indeed. But trying that in our demo environment does not make it work.

What does work in both cases is removing the @onkeydown:preventDefault="true" and I'm not understanding why you would even want to have that on the (Fluent)EditForm. (FluentEditForm is just a thin wrapper for EditForm which only does something useful when used in combination with the Wizard component)

So, as there is a workaround by not using the @onkeydown, I'm closing this issue.

from fluentui-blazor.

miszelek avatar miszelek commented on July 4, 2024

OK, thanks for the information and investigation.

The EditForm gives me input validation before Submit. My reason for the @onkeydown was to prevent the OnSubmit to fire when the Enter key was pressed.

But perhaps there is another (and better) way to prevent that?

from fluentui-blazor.

miszelek avatar miszelek commented on July 4, 2024

Did some more research and found a way to prevent OnSubmit fire after Enter.
The @onkeydown:preventDefault does not work, but handling it yourself does.

public static class Form
{
    private static bool _allowSubmit = true; 

    public static void HandleKeyDown(KeyboardEventArgs args)
    {
        _allowSubmit = args.Key != "Enter";
    }

    public static bool AllowSubmit()
    {
        if (_allowSubmit) return true;
        _allowSubmit = true;
        return false;
    }
}

Usage: Set @onkeydown="Form.HandleKeyDown" on the EditForm and do this in Submit() handler: if (!Form.AllowSubmit()) return;

Btw, I love FluentUI, keep up the good work!

from fluentui-blazor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.