Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typeahead: OnSelectedItemChanged gets triggered twice #104

Open
AncientGrief opened this issue Nov 29, 2021 · 1 comment · Fixed by #106 · May be fixed by #97
Open

Typeahead: OnSelectedItemChanged gets triggered twice #104

AncientGrief opened this issue Nov 29, 2021 · 1 comment · Fixed by #106 · May be fixed by #97
Assignees
Labels
bug Something isn't working

Comments

@AncientGrief
Copy link

OnSelectedItemChanged get's triggered twice when clicking an item with the mouse or using the Enter button:

    <TypeaheadInput id="in1" class="form-control bg-dark" placeholder="@("Add Item ...")"
                @ref="refAddItemInput"
                Data="DataProvider.Items"
                LabelPropertySelector="x => x.Name"
                @bind-Value="@AddItemInput"
                SelectOnBlur="false"
                OnInput="@(text => {SelectedItemToAdd = null; typeaheadInputValue = text;})"
                TItem="Item"
                OnSelectedItemChanged="OnAddItem">
        <ItemTemplate>
            <div>
                <label>@context.Name</label>
            </div>
        </ItemTemplate>
    </TypeaheadInput>
  ...
    private void OnAddItem(Item item)
    {
        Model.AddItemToActiveStash(item);
    }
@majorimi majorimi self-assigned this Nov 30, 2021
@majorimi majorimi added the bug Something isn't working label Nov 30, 2021
@majorimi
Copy link
Owner

Hi @AncientGrief, sorry for the late answer I was sick.

Yes checked it and it looks there is a double event triggering for OnSelectedItemChanged. Will resolve this in next release. Thanks.

This was linked to pull requests Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants