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

[Bug] Selected value is not displayed #263

Closed
nabrezzelt opened this issue Mar 2, 2022 · 3 comments · Fixed by #278
Closed

[Bug] Selected value is not displayed #263

nabrezzelt opened this issue Mar 2, 2022 · 3 comments · Fixed by #278
Labels
Bug Something isn't working Triage Issue needs to be triaged

Comments

@nabrezzelt
Copy link

Describe the bug
After setting the Value-Property (click the button) the value is not displayed:

grafik

To Reproduce
Steps to reproduce the behavior:

  1. Click the Test Button

Expected behavior
The Value should be displayed after setting the Value-property manual.

Screenshots
If applicable, add screenshots to help explain your problem.

Hosting Model:

  • Blazor Server

Sample code:

<p>@_customer?.FullName</p>
<BlazoredTypeahead TValue="Customer"
                   TItem="Customer"
                   SearchMethod="@SearchCustomer"
                   @bind-Value="_customer"
                   Debounce="500">
    <SelectedTemplate>
        @context.FullName
    </SelectedTemplate>
    <ResultTemplate>
        @context.FullName
    </ResultTemplate>
    <NotFoundTemplate Context="_">
        No customer found.
    </NotFoundTemplate>
</BlazoredTypeahead>

<button @onclick="SetCustomer">test</button>

@code {
    private Customer _customer;

    private void SetCustomer()
    {
        _customer = new Customer();
    }

    private async Task<IEnumerable<Customer>> SearchCustomer(string s)
    {
        return await Task.FromResult(new List<Customer>());
    }

    private class Customer
    {
        public string FullName = "Mayer, Hans";
    }
}
@nabrezzelt nabrezzelt added Bug Something isn't working Triage Issue needs to be triaged labels Mar 2, 2022
@djukic-marko
Copy link

Hello there :)
I beleve this is a duplicate of this issue.
Try downgrading to 4.5.1...

@benshemmeld
Copy link
Contributor

@nabrezzelt I have fixed this bug in this PR #278

@nabrezzelt
Copy link
Author

Hi, thanks for investigating and solving the problem :). I will try it the next days.

And thanks @djukic-marko for the info about the rollback to 4.5.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working Triage Issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants