Code Monkey home page Code Monkey logo

Comments (6)

Joe-LaRue avatar Joe-LaRue commented on May 23, 2024

It looks like the way to do this is to instantiate an instance of the typeahead, reference it in the markup declaration via the @ref attribute, and then call a method on the component when needed.

example:
typeAhead1
typeAhead2

from typeahead.

vertonghenb avatar vertonghenb commented on May 23, 2024

You could do this with some JS and using the .css class of the control.
However @chrissainty and myself have been thinking to create a Blazored.Essentials package so you could express this easier for example:

<BlazoredTypeahead SearchMethod="GetPeopleLocal"
                   @ref="myTypeahead"
                   @bind-Value="SelectedPerson"
                   ShowDropDownOnFocus="true"
                   placeholder="Search by first name...">
    <SelectedTemplate Context="person">
        @person.Firstname
    </SelectedTemplate>
    <ResultTemplate Context="person">
        @person.Firstname @person.Lastname
    </ResultTemplate>
</BlazoredTypeahead>
@code {
    ElementReference myTypeahead;
    protected override void OnInitialized()
    {
         myTypeahead.Focus();
    }
}

@chrissainty
Maybe we should go ahead and start on this Blazored.Essentials or Blazored.Foundation or Blazored.Core or ... package?, if you provide a repo I can start laying the foundation.

from typeahead.

Joe-LaRue avatar Joe-LaRue commented on May 23, 2024

I'd be interested in pitching in if you want the help :)

from typeahead.

chrissainty avatar chrissainty commented on May 23, 2024

@vertonghenb Yes - we should make a move on that project. Blazored.Essentials seems like a good name. I'll get the repo created.

@Joe-LaRue The more the merrier, I'll get the repo setup then we can get some issues going

from typeahead.

chrissainty avatar chrissainty commented on May 23, 2024

I am I right in thinking this issue can be closed now @Joe-LaRue ?

from typeahead.

Joe-LaRue avatar Joe-LaRue commented on May 23, 2024

Yea - it sounds like the plan is to handle it via Blazored.Essentials.

from typeahead.

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.