Skip to content

Commit

Permalink
fix: getValue
Browse files Browse the repository at this point in the history
  • Loading branch information
m2a2x committed Jan 15, 2025
1 parent 0b36550 commit e1d2d25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@revolist/revogrid-column-select",
"version": "3.1.8",
"version": "3.1.9",
"description": "Select column type for RevoGrid system based on revo-dropdown",
"main": "./dist/revo-common-select.umd.cjs",
"module": "./dist/revo-common-select.mjs",
Expand Down
12 changes: 9 additions & 3 deletions src/editor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EditCell, EditorBase, HyperFunc, VNode } from '@revolist/revogrid';
import { ChangeValue, SelectConfig } from './type';
import { type EditCell, type EditorBase, type HyperFunc, type VNode } from '@revolist/revogrid';
import { type ChangeValue, type SelectConfig } from './type';

export class SelectColumnEditor implements EditorBase {
constructor(
Expand All @@ -14,9 +14,14 @@ export class SelectColumnEditor implements EditorBase {
// private closeCallback: (focusNext?: boolean) => void
) {}

element?: Element | null;
element?: HTMLRevoDropdownElement | null;
editCell?: EditCell;
componentDidRender() {}

getValue() {
return this.element?.value;
}

render(h: HyperFunc<VNode>, _additionalData: any) {
let val = '';
let filter = '';
Expand All @@ -30,6 +35,7 @@ export class SelectColumnEditor implements EditorBase {
const column = this.data?.column;
return h('revo-dropdown', {
...column,
ref: (e: HTMLRevoDropdownElement | null) => (this.element = e),
dataId: column?.valueKey,
dataLabel: column?.labelKey,
autocomplete: true,
Expand Down

0 comments on commit e1d2d25

Please sign in to comment.