How to remove grid selection elements if not using popup form
See original GitHub issueVersion
I’m using 2.0.2
Test Environment
Chrome, MacOS, React v18
Current Behavior
Here’s a reproduction: https://codesandbox.io/s/gracious-lehmann-bmnuf0?file=/src/App.js
I’m new to TUI Calendar, but from reading the API/docs, I assume this is how it we’re supposed to create events without using the popup, using the onSelectDateTime
and the events
prop:
onSelectDateTime={(event) => {
setEvents([...events, { start: event.start, end: event.end }]);
}}
events={events}
But I don’t know how I can remove the selection element after
https://user-images.githubusercontent.com/732422/179431161-49e91881-4b9e-4c8b-af36-494b186295d0.mov
I’ve tried doing this:
event.gridSelectionElements.forEach((element) => {
// I don't know why this setTimeout is needed, but it doesn't work without
setTimeout(() => {
element.remove();
}, 0);
});
And it works, but if I change the events
array, it re-renders the selection element.
Expected Behavior
I don’t believe it is a bug. I think it’s my knowledge gap that I need help with.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How can I prevent text/element selection with cursor drag
Dragging still invokes pointer events similar to text selection. Try applying user-select: none to an element and dragging over it. Sure there are...
Read more >Popup Editing - DevExtreme Data Grid
Set the editing object's allowUpdating, allowAdding, and allowDeleting properties to true. DataGrid uses the DevExtreme Form and Popup components to display the ...
Read more >Grid Selection - Telerik UI for Blazor - Documentation
In Inline EditMode and PopUp EditMode selection can be done by clicking on the desired row or by using a <GridCheckboxColumn /> ....
Read more >Configure pop-ups—ArcGIS Pro | Documentation
These elements do not have a visible border. Element choices are listed as buttons at the top of the pane. Click an element...
Read more >Form Grid - Knowledge Base for DX 7 - Joget | COMMUNITY
If the popup form has a grid element(s), this option will delete the inner grid data. ... These 3 options: (Delete Associated Grid...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@gustavo-depaula
Here’s a simple example code with types. You can use the class component itself for the generic type for the
useRef
hook.You’re a genius @adhrinae!!
Thanks for all the help!