Skip to content

Commit

Permalink
fix(#632): add passthrough attrs to DruxtField (#633)
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher authored May 11, 2023
1 parent 6ea17e3 commit 39af33a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/big-worms-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"druxt-entity": patch
---

fix(#632): add passthrough attrs to DruxtField
8 changes: 4 additions & 4 deletions packages/entity/src/components/DruxtField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export default {
// File: View.
if (this.isFile && schemaType === 'view') {
return h('DruxtEntity', {
attrs,
attrs: { ...attrs, ...self.$attrs },
props: {
langcode: this.lang,
type: item.type,
Expand All @@ -310,7 +310,7 @@ export default {
// Image: View
if (this.isImage && schemaType === 'view') {
return h('DruxtEntity', {
attrs,
attrs: { ...attrs, ...self.$attrs },
props: {
langcode: this.lang,
type: item.type,
Expand Down Expand Up @@ -352,7 +352,7 @@ export default {
// Relationship: View.
if (this.relationship && (item || {}).id && schemaType === 'view') {
return h('DruxtEntity', {
attrs,
attrs: { ...attrs, ...self.$attrs },
props: {
langcode: this.lang,
mode: this.schema.settings.display.view_mode || 'default',
Expand All @@ -365,7 +365,7 @@ export default {
// Relationship: Form.
if (this.relationship && (item || {}).id && schemaType === 'form') {
return h('details', [h('DruxtEntityForm', {
attrs,
attrs: { ...attrs, ...self.$attrs },
props: {
langcode: this.lang,
mode: this.schema.settings.display.view_mode || 'default',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ exports[`DruxtField fallback - form 1`] = `
exports[`DruxtField file - view 1`] = `
"<div data=\\"[object Object]\\">
<div data=\\"[object Object]\\" errors=\\"\\" relationship=\\"true\\" schema=\\"[object Object]\\" value=\\"[object Object]\\">
<div>
<div entity=\\"[object Object]\\" value=\\"[object Object]\\"><a target=\\"_blank\\" href=\\"/sites/default/files/mediterranean-quiche-umami.jpg\\">mediterranean-quiche-umami.jpg</a></div>
<div data=\\"[object Object]\\">
<div data=\\"[object Object]\\" entity=\\"[object Object]\\" value=\\"[object Object]\\"><a target=\\"_blank\\" href=\\"/sites/default/files/mediterranean-quiche-umami.jpg\\">mediterranean-quiche-umami.jpg</a></div>
</div>
</div>
</div>"
Expand All @@ -34,8 +34,8 @@ exports[`DruxtField file - view 1`] = `
exports[`DruxtField image - view 1`] = `
"<div data=\\"[object Object]\\">
<div data=\\"[object Object]\\" errors=\\"\\" relationship=\\"true\\" schema=\\"[object Object]\\" value=\\"[object Object]\\">
<div>
<div entity=\\"[object Object]\\" value=\\"[object Object]\\"><img src=\\"/sites/default/files/mediterranean-quiche-umami.jpg\\"></div>
<div data=\\"[object Object]\\">
<div data=\\"[object Object]\\" entity=\\"[object Object]\\" value=\\"[object Object]\\"><img src=\\"/sites/default/files/mediterranean-quiche-umami.jpg\\"></div>
</div>
</div>
</div>"
Expand Down

0 comments on commit 39af33a

Please sign in to comment.