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

Fixes #217 - bug where the selected value is not displayed #278

Merged
merged 1 commit into from
Jul 15, 2022
Merged

Fixes #217 - bug where the selected value is not displayed #278

merged 1 commit into from
Jul 15, 2022

Conversation

benshemmeld
Copy link
Contributor

@benshemmeld benshemmeld commented Jul 14, 2022

Fixed bug where the selected value is not displayed
I think the call to Initialize from OnParametersSet was removed by mistake in this commit 4c6d3ba
and then later the commented line was removed.

Resolves #217
Resolves #263

This was referenced Jul 14, 2022
Copy link

@djukic-marko djukic-marko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this contribution and for digging it out.
Verry similar kinds of bugs often happen in our environment (someone thinks the render is unnecessary, so they remove it).
Thank you for digging it out and allowing me to update again to the latest version without problems!!!

Copy link
Member

@chrissainty chrissainty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this @benshemmeld! 👍

@chrissainty chrissainty added the Bug Something isn't working label Jul 15, 2022
@chrissainty chrissainty merged commit 90583f9 into Blazored:main Jul 15, 2022
@snibe
Copy link

snibe commented Jul 19, 2022

after updating to 4.7.0 every time i type it clears out what i typed from the box, this is not happening in 4.6.0

@djukic-marko
Copy link

Hmm, I couldn`t reproduce it...
Steps I tried:

  1. Enter a value into TypeAhead and bind it to an object
  2. Move focus elsewhere
  3. Get back into TypeAhead and start typing but do not finish!
  4. Move focus elsewhere

After step 4, the bound value of TypeAhead is the same object that was bound in step 1. I don't see the value or text cleared from the box?

@snibe
Copy link

snibe commented Jul 19, 2022

sorry after testing on another app it seems to be fine and something odd in my code that might be causing it. I apologize i will do further testing.

@snibe
Copy link

snibe commented Jul 20, 2022 via email

@bfmikea
Copy link

bfmikea commented Aug 17, 2022

It happens to me similar to @snibe . After updating to 4.7.0 every time i type it clears out what i typed from the box, this is not happening in 4.6.0. I have not been able to solve it.

@bfmikea
Copy link

bfmikea commented Aug 17, 2022

Commenting out the StateHasChanged(); It works well.

private async Task<IEnumerable<CodigoRevisionModel>> SearchCodigos(string SearchText)
        {
            if (SearchText != null)
            {
                Filtros.SearchTextRevision = SearchText;

                using var res = await ApiHelper.GetCodigoRevision(Http, Filtros);

                if (res.IsSuccessStatusCode)
                {
                    // convert response data to object
                    _listCodigoRevision = await res.Content.ReadFromJsonAsync<List<CodigoRevisionModel>>();

                    //StateHasChanged();

                }
            }

            return _listCodigoRevision;
        }

@SSchulze1989
Copy link

SSchulze1989 commented Oct 9, 2022

@benshemmeld this crated a new bug when the OnParametersSet() method is called repeatedly after the intialization
see #288
This happens for example when using together with Blazored.Modal and [CascadingParameter] BlazoredModalInstance

Why is it needed to call Initialize() inside OnParametersSet() when it should have already been called from OnInitialized()?
Maybe just calling IsShowingMask = Value != null; is enough to fix the previous issue without clearing the input all the time?

matijs-toonen added a commit to matijs-toonen/Typeahead that referenced this pull request Apr 17, 2024
* Bit of tidying up

* Fixed bug where the selected value is not displayed (Blazored#278)

Co-authored-by: Ben Shemmeld <[email protected]>

* Updated TFM to .NET 6 and updated CI (Blazored#280)

* Update README.md

---------

Co-authored-by: Chris Sainty <[email protected]>
Co-authored-by: Ben Shemmeld <[email protected]>
Co-authored-by: Ben Shemmeld <[email protected]>
Co-authored-by: Chris Sainty <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Selected value is not displayed @bind-Value issue
6 participants