Coder Social home page Coder Social logo

Comments (2)

jbomhold3 avatar jbomhold3 commented on June 18, 2024

Your attempting to do something that's not supported even with the base InputText. While I could make this work by adding a preventdefault parameter and attribute for each event type. It will get super messy as there are a lot of events. Until they have a better way of passing down the argument predicting all the possible uses that might be needed doesn't seem reasonable. The fact Microsoft hasn't even added a method to support this in their input components. Tells me that they intend you to drop out of the component when trying to use more advanced event binding.

From what you provided as an example, I'm seeing other errors that would prevent that from working anyways. I recommend dropping down to the base HTML input tag and doing.

<input type="text" class="form-control" @onkeydown="KeyDown" @onkeydown:preventDefault="shouldPrevent"> 

or if you're just intending just to get the value right away, you can do something like

<BSInput InputType="InputType.Text" ValidateOnInput="true" ValueChanged="@((string txt) => OnValueChanged(txt))" value="@Modal.MiddleName" ValueExpression="@(() => Modal.MiddleName)" />
    private void OnValueChanged(string e)
    {
        Modal.MiddleName = e;
        Console.WriteLine(e);
    }

from blazorstrap.

yaju avatar yaju commented on June 18, 2024

Thanks.
do it another way.

from blazorstrap.

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.