Comments (2)
To implement the ability to reset the selected field value to empty:
-
Modify
SettingsDataModelFieldSelectForm.tsx
:- Add logic to include a 'No [fieldName]' option in the select dropdown.
- Update the
onChange
handler to set the value tonull
when 'No [fieldName]' is selected.
-
Update
SettingsObjectFieldSelectForm.tsx
:- Ensure the select field renders the 'No [fieldName]' option dynamically based on the field name.
-
Adjust
useClearField.ts
:- Implement functionality to clear the field value by setting it to
null
when the 'No [fieldName]' option is selected.
- Implement functionality to clear the field value by setting it to
Example Code Snippet:
// In SettingsDataModelFieldSelectForm.tsx
const handleChange = (selectedOption) => {
if (selectedOption.value === `No ${fieldName}`) {
setFieldValue(null);
} else {
setFieldValue(selectedOption.value);
}
};
// In SettingsObjectFieldSelectForm.tsx
const options = [
...existingOptions,
{ value: `No ${fieldName}`, label: `No ${fieldName}` }
];
// In useClearField.ts
const clearField = () => {
setFieldValue(null);
};
from twenty.
Related Issues (20)
- "Invalid enum label" error at field select creation HOT 1
- "Cannot compute column name for composite field metadata type" error HOT 1
- Relation selection is broken on Activity in create state HOT 1
- I should be able to reset the primary link of a Links field HOT 1
- When exporting a kanban we should export the kanban's main field HOT 1
- Edit kanban's main field HOT 1
- text input field focus should deactivate shortcuts HOT 1
- After upgrade from 0.12.0 to 0.20.0 timeline is empty HOT 3
- Add member (eg "invite sent" state) in members list when inviting a new member via email HOT 2
- I should be able to sort by amount HOT 1
- Remove handleDeleteWorkspaceMember and handleDeleteBlocklistItem from WorkspaceQueryRunnerService
- Release 0.21
- Docker: in version 0.20 timelime is empty HOT 2
- Return only updated fields of records in zapier update trigger HOT 1
- Disable New Registrations and Signups HOT 2
- Add deletion confirmation modals to tasks, notes and single objects HOT 3
- Filter "Is Empty" / "Is not Empty" broken HOT 1
- Select with drag triggers scroll at bottom and top of index page HOT 3
- Improve messaging and calendar DB queries using indexMetadata to create indexes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twenty.