Mantine UI – onBlur, onChange not working TextInput, Input – Solution

Fix or solution for not working of onBlur and onChange in Mantine UI forms. How to trigger onBlur, onChange in mantine UI for field components.

        onBlur={event => {
          form.getInputProps('title').onBlur(event);
          handleSave()
        }}

        onChange={event => {
          form.getInputProps('name').onChange(event);
          handleSave()
        }}

Example

      <TextInput
        variant="unstyled"
        placeholder="Enter question description here"
        {...form.getInputProps("description")}
        styles={{
          input: {
            fontSize: '1.1rem', 
            fontWeight:400
          },
        }}
        onBlur={event => {
          form.getInputProps('description').onBlur(event);
          handleSave()
        }}
      />

About the Author: smartcoder

You might like

Leave a Reply

Your email address will not be published. Required fields are marked *