IUIKitSurface State does not hold value if initialValue is used in a InputBlock
haemza30 opened this issue · comments
What?
When I am trying to read a value from IUIKitViewSubmitIncomingInteraction.IUIKitSurface.state:
- if the value of say a input box is unchanged (it uses initialValue) then I get undefined
- if the value of input box is altered (changed once from initialValue) I am successfully able to retrieve the value
Steps to reproduce?
-
Create a block
const block: InputBlock = { type: "input", label: { type: "plain_text", text: labelText, }, element: { type: "plain_text_input", placeholder: { type: "plain_text", text: 'Enter your ID', }, appId: 'app-id, blockId: 'block-id', actionId: 'action-id', initialValue: '12345' }, };
-
Use the above block in UIKitSurfaceType.MODAL
-
Try to retrieve the value of input box in the submit handler:
const id = data.view.state.'block-id'.'action-id'; // here data is IUIKitViewSubmitIncomingInteraction
-
If you don't change the initialValue of the input box you will get id as undefined, but if you even change a character in it it will work fine
PS
Expectation:
Must get value even if the input box has unchanged initialValue