Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove debounce from form & disallow editing of the root field's id #10

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/admin/components/PropertyEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const PropertyEditor = () => {
<Col xs={18} data-cy="editFieldId">
<Typography.Title
level={5}
editable={{
editable={pathObj.path.length && {
text: name,
onChange: value => dispatch(renameIdByPath({path: pathObj, newName: value})),
}}
Expand Down
4 changes: 3 additions & 1 deletion src/admin/components/SchemaPreview.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import PropTypes from "prop-types";
import { Button, Col, Row, Typography } from "antd";
import { Button, Col, Row, Tooltip, Typography } from "antd";
import SchemaTree from "../components/SchemaTree";
import { SettingOutlined } from "@ant-design/icons";
import { useDispatch, useSelector } from "react-redux";
Expand Down Expand Up @@ -32,6 +32,7 @@ const SchemaPreview = () => {
<Typography.Title level={5} style={{ margin: 0 }} ellipsis data-cy="rootTitle">
{(schema && schema.title) || "root"}
</Typography.Title>
<Tooltip title="Edit root settings">
<Button
type="link"
shape="circle"
Expand All @@ -40,6 +41,7 @@ const SchemaPreview = () => {
className="tour-root-settings"
data-cy="rootSettings"
/>
</Tooltip>
</Row>
<Row style={{ padding: "0 10px" }}>
<Typography.Text type="secondary" level={5} data-cy="rootDescription">
Expand Down
3 changes: 1 addition & 2 deletions src/forms/Form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { useContext } from "react";
import { Provider, useDispatch } from "react-redux";
import store from "../store/configureStore";
import { updateFormData } from "../store/schemaWizard";
import { debounce } from "lodash-es";

const RJSFForm = ({
formRef,
Expand Down Expand Up @@ -96,7 +95,7 @@ const RJSFForm = ({
customValidate={validate}
validator={validator}
extraErrors={extraErrors}
onChange={debounce(handleChange, 150)}
onChange={handleChange}
readonly={readonly}
transformErrors={transformErrors}
formContext={{
Expand Down