Hi,
I'm using the Prefix & Suffix example or the input control as a starting point (Link), and I'm trying to respond to a click event on the suffix part of the control. This is my component definition:
<IgbInput @ref="ctlSearchText" Inputmode="@InputInputmode.Txt" DisplayType="@InputType.Text" Label="" > <span slot="prefix">Find</span> <IgbIcon slot="suffix" @ref="IconRef" IconName="phone" Collection="material" onclick="@(async ()=> await DoSearch())"/> </IgbInput>
The problem I'm having is that when my click handler is called I'm unable to get the current value from the IgbInput - it always returns an empty string. I've tried a number of approaches:
The closest I've got is handling the keypress event, but that isn't any use as it only provides the last character pressed, and I can't reliably use this to get the full control text
I'm sure I must be missing something, after all, what use is an editable component if you can't retrieve the value that is being edited, but I'm drawing a blank on how to proceed - any suggestions?
I have a workaround using javascript interop, but I'd sooner know how to do this properly!
Hello Kevin,
You can leverage the onInput event of the IgbInput component to keep track of the entered text.
eg.
https://github.com/IgniteUI/igniteui-blazor/issues/1
Please see the attached prefix/suffix modified sample linked below.
prefix-suffix.zip