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

IconEditor is crashing with incorrect setFocus call #663

Open
raplemie opened this issue Jan 5, 2024 · 1 comment
Open

IconEditor is crashing with incorrect setFocus call #663

raplemie opened this issue Jan 5, 2024 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@raplemie
Copy link
Contributor

raplemie commented Jan 5, 2024

Describe the bug
When using an editor with IconPicker type, there is a crash as this is attempting to call setFocus on a ref.

imports...
  StandardEditorNames as Editor,
  PropertyEditorParamTypes as EditorParam,
  StandardTypeNames as Type,

/** Create a property record to test, allowing editors to be defined. */
function createPropertyRecord(
  type: Type,
  value: any,
  editor?: Editor | PropertyRecord["property"]["editor"]
) {
  return new PropertyRecord(
    {
      valueFormat: PropertyValueFormat.Primitive,
      value,
    },
    {
      typename: type,
      name: "",
      displayLabel: "",
      editor: typeof editor === "string" ? { name: editor } : editor,
    }
  );
}
createPropertyRecord(Type.String, "icon-app-2", {
          name: Editor.IconPicker,
          params: [
            {
              type: EditorParam.IconListData,
              iconValue: "icon-app-2",
              numColumns: 2,
              iconValues: ["icon-app-1", "icon-app-2", "icon-apps-itwin"],
            } as IconListEditorParams,
          ],
        }),

Validate if this "always" crash or the test conditions caused it, if it always crash, validate if the component is really needed, or if the implementation could be completely changed...

@FlyersPh9 FlyersPh9 added the bug Something isn't working label Jan 8, 2024
@GerardasB GerardasB added the good first issue Good for newcomers label Aug 8, 2024
@GerardasB
Copy link
Collaborator

Add IconEditor to our storybook to validate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants