diff --git a/packages/builder/src/builderStore/store/backend.js b/packages/builder/src/builderStore/store/backend.js index d89796f9cc..6500febb2d 100644 --- a/packages/builder/src/builderStore/store/backend.js +++ b/packages/builder/src/builderStore/store/backend.js @@ -94,7 +94,8 @@ export const getBackendUiStore = () => { saveField: ({ originalName, field }) => { store.update(state => { // delete the original if renaming - if (originalName) { + // need to handle if the column had no name, empty string + if (originalName || originalName === "") { delete state.draftTable.schema[originalName] state.draftTable._rename = { old: originalName, diff --git a/packages/builder/src/components/backend/DataTable/popovers/ColumnPopover.svelte b/packages/builder/src/components/backend/DataTable/popovers/ColumnPopover.svelte index e4db32d900..071d8038bf 100644 --- a/packages/builder/src/components/backend/DataTable/popovers/ColumnPopover.svelte +++ b/packages/builder/src/components/backend/DataTable/popovers/ColumnPopover.svelte @@ -43,7 +43,11 @@ function sort(direction, column) { backendUiStore.update(state => { - state.sort = { direction, column } + if (direction !== "none") { + state.sort = {direction, column} + } else { + state.sort = undefined + } return state }) hideEditor() @@ -70,6 +74,12 @@ Delete + {#if sortDirection === 'desc' || sortDirection === 'asc'} +
  • sort('none', field.name)}> + + Remove sort +
  • + {/if} {#if sortDirection === 'desc' || sortColumn !== field.name}
  • sort('asc', field.name)}>