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

#8728 prototype #8730

Closed
wants to merge 5 commits into from
Closed

#8728 prototype #8730

wants to merge 5 commits into from

Conversation

driskull
Copy link
Member

Related Issue: #

Summary

.calcite-sortable--drag {
.calcite-sortable--drag,
.calcite-sortable--fallback {
position: relative;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part fixes the styling error for the dragging element.

@@ -2,6 +2,8 @@
@apply flex flex-col;
--calcite-list-item-icon-color: theme("colors.brand");
--calcite-list-item-spacing-indent: theme("spacing.4");
// uncomment this and it works with `forceFallback: true,`
// padding-block: 10px;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introducing a padding between items seems to fix the dragging when fallback is enabled. Need to figure out why dragging on a web component isnt triggering elements to swap unless there is space between them. cc @jcfranco

@@ -13,6 +13,7 @@ export const CSS = {
ghostClass: "calcite-sortable--ghost",
chosenClass: "calcite-sortable--chosen",
dragClass: "calcite-sortable--drag",
fallbackClass: "calcite-sortable--fallback",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added fallback class css for usage if necessary.

@driskull
Copy link
Member Author

@jcfranco I can get sortable working if I change the following:

https://github.com/SortableJS/Sortable/blob/07708fa1e7d9cf9d4563a7b1a09f7a47771522ed/src/Sortable.js#L764-L770

From:

			if (parent) {
				do {
					if (parent[expando]) {
						let inserted;

						inserted = parent[expando]._onDragOver({
							clientX: touchEvt.clientX,

To:

      if (parent) {
        do {
          // todo
          const test = parent[expando] || dragEl.parentNode[expando];
          if (test) {
            var inserted = void 0;
            inserted = test._onDragOver({
              clientX: touchEvt.clientX,

@jcfranco
Copy link
Member

Thanks for working on this! ✨💪✨

Could we apply the fallback and extra padding only for mobile platforms (via userAgent)? We'd have to note this as a known issue for the time being. cc @ashetland @geospatialem

I was not able to find any similar issue in SortableJS, so this might be an upstream issue that they would need to address. Could you submit an issue for this? Sharing your findings above would be helpful.

@driskull driskull closed this Feb 14, 2024
@driskull driskull deleted the dris0000/drag-test-8728 branch February 14, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants