-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add editable label directive to UI module #790
Conversation
Affected libs:
|
@jahow can you confirm this is the technical approach you had in mind ? |
GitHub Pages links:
|
Yes I also like the approach of a directive, it gives more freedom for styling the affected label. I would suggest trying to use the element inner text as Having a complete story on storybook is enough to validate and merge this. Thanks! |
1e10eae
to
2884457
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, simple and efficient! I just noticed an issue with the original content of the lael being prepended and appended with spaces. Feel free to merge when this is sorted out :)
this.renderer.setStyle(appendedInput, 'text-decoration', 'inherit') | ||
|
||
const hostContent = this.el.nativeElement.innerHTML | ||
this.renderer.setProperty(appendedInput, 'value', hostContent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hostContent
needs to be trimmed, otherwise there will be blanks in the first and last positions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(or innerText could be used instead, I'm not sure if that would change anything)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well spotted! As we decided this should be specific to text elements, I'll go with textContents
, and trim()
.
2884457
to
eaf2a1f
Compare
Description
This PR introduces a new directive, to edit in place fields like titles and names.
Architectural changes
Strangely enough, the
RecordFormComponent
was declared as standalone, but not importing anything more thanCommonModule
. Had to at least importUiInputsModule
for it to work properly.Added the new
EditableLabelDirective
to theUiInputsModule
too.Quality Assurance Checklist