mapbox / mapbox/mr-ui

Form component ends in Loader

Open
#233 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
90
Forks
5
PR merge metrics
No merged PRs in 30d

Description

I don't understand where the Loader is being invoked or what the logic of it is:
The code below is close to verbatim from the Example in the components doc.
Screenshot 2025-01-01 at 8 33 27 AM

The Loader apparently comes after the _submitForm(controlValues)_ inside _handleFormData_

import React, { useState } from 'react';
import Form from '@mapbox/mr-ui/form';
import FormSubmit from '@mapbox/mr-ui/form-submit';
import ControlText from '@mapbox/mr-ui/control-text';
// import validateRequired from '@mapbox/mr-ui/validators/validate-required';

function validateNoOp(value) {
console.log('val', value);
return '';
}
const formConfig = {
name: {
label: 'Search term',
placeholder: 'Text to match in profiles',
validator: validateNoOp, // validateRequired('Your name'),
},
};

const InputForm = (props) => {
const renderForm = (getControlProps, onSubmit) => {
return (
<>








);
};

const submitForm = (values) => {
console.log('sub', values);
if (props.onSubmit) props.onSubmit(values);
};

const handleFormData = (controlValues) => {
console.log('handle', controlValues);
submitForm(controlValues);
return controlValues;
};

return (

);
};
export default InputForm;

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the components documentation example shown in the issue, then trace the Form and FormSubmit components and the handleFormData callback to identify where the Loader appears. Document the invocation and control flow clearly, including what the example should show so users can understand the resulting behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
documentation, frontend
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.