File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
src/extensions/yfm/YfmTable/plugins/YfmTableControls/dnd Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -212,15 +212,18 @@ export class YfmTableDnDGhost {
212212 const button = target . closest ( '.g-button' ) ;
213213 if ( ! button ) return null ;
214214
215+ const container = button . ownerDocument . createElement ( 'div' ) ;
216+ container . classList . add ( 'g-md-yfm-table-dnd-ghost-button' ) ;
217+
215218 const rect = button . getBoundingClientRect ( ) ;
216- const cloned = button . cloneNode ( true ) as HTMLElement ;
219+ const cloned = container . appendChild ( button . cloneNode ( true ) as HTMLElement ) ;
217220
218221 removeIdAttributes ( cloned ) ;
219222 cloned . style . cursor = '' ;
220- cloned . classList . add ( 'g-md-yfm-table-dnd-ghost-button' ) ;
223+ cloned . style . pointerEvents = 'none' ;
221224
222225 return {
223- domElement : cloned ,
226+ domElement : container ,
224227 shiftX : rect . left - this . _x ,
225228 shiftY : rect . top - this . _y ,
226229 } ;
Original file line number Diff line number Diff line change 1111}
1212
1313.yfm.g-md-yfm-table-dnd-ghost ,
14- .g-button.g- md-yfm-table-dnd-ghost-button {
14+ .g-md-yfm-table-dnd-ghost-button {
1515 position : fixed ;
1616
1717 cursor : grabbing ;
3232 }
3333}
3434
35- .g-button.g- md-yfm-table-dnd-ghost-button {
35+ .g-md-yfm-table-dnd-ghost-button {
3636 --g-button-background-color-hover : var (--g-color-base-background );
3737 --g-button-background-color : var (--g-color-base-background );
3838 --g-button-border-color : var (--g-color-line-brand );
You can’t perform that action at this time.
0 commit comments