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

RichTextEditor ElementId is null and not autogenerated #3190

Closed
tpGroupcare opened this issue Nov 30, 2021 · 0 comments
Closed

RichTextEditor ElementId is null and not autogenerated #3190

tpGroupcare opened this issue Nov 30, 2021 · 0 comments
Assignees
Labels
Type: Bug 🐞 Something isn't working

Comments

@tpGroupcare
Copy link

tpGroupcare commented Nov 30, 2021

Usually when I reference a blazorise component then I can ref it and access the autogenerated ElementId.

Example

<Button @ref="TheButton">Click me</Button>
@code{
  private Button TheButton;

  private void someMethod(){
    var buttonAutogeneratedElementId = TheButton.ElementId;
    // use the elementId in some JS operation
  }
}

However, if the component is the RichTextEditor then the ElementId is null and I have to come up with my own way of uniquely generating it.

For now, I have worked around the issue like this

<RichTextEdit @ref="@_richTextEditor" ElementId="@_editorId" />

@code{
  private readonly string _editorId = $"someText{Guid.NewGuid()}";
}

I am using version 0.9.5

@stsrki stsrki self-assigned this Dec 1, 2021
@stsrki stsrki added the Type: Bug 🐞 Something isn't working label Dec 1, 2021
@stsrki stsrki added this to the 0.9.5 Support milestone Dec 1, 2021
This was referenced Dec 1, 2021
@stsrki stsrki closed this as completed Dec 1, 2021
@stsrki stsrki added this to Support Aug 3, 2024
@stsrki stsrki moved this to ✔ Done in Support Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐞 Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants