vuetify-jsonschema-form icon indicating copy to clipboard operation
vuetify-jsonschema-form copied to clipboard

x-props partially working

Open mttmccb opened this issue 4 years ago • 7 comments

You'll see it in the example pen, that the chips property isn't being applied https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/examples#vuetify-props, I tried on my dev environment and hide-selected did so unsure if it's a problem with this component. When inspecting the component (suing vue dev tools) the property is passed through but it's not rendered that way. Any ideas or possible workarounds for this?

mttmccb avatar Jul 26 '21 11:07 mttmccb

Ah yes, sorry I missed this regression.

In order to support more cases vjsf defines the selection slot of the v-select component. Therefore some standard props are ignored. I don't really know what to do about that. I need to think about it, I see a few possibilities:

  • re-implement some of the props to recreate the original vuetify behavior (can create quite a lot of complexity)
  • either find a way to stop using the slot, or separate the cases where the slot is really necessary (I don't remember exactly what they are) and stop using it the rest of the time
  • just let it go as it is and fix the doc

albanm avatar Aug 17 '21 14:08 albanm

Hi!

I found a similar issue when I tried to pass a vuetify property of v-expansion-panel through 'x-props' in order to make a panel always opened or expanded. The property was readonly: true or disabled: true. But didn't work.

I checked ObjectContainer.js and I noticed that x-props are missing as a parameter in the render function of v-expansion-panel component. Check out line 132.

So, to solve my issue I added this: props: { ...schema['x-props'] } image

I don´t know if this is a bug or I'm missing another way to achieve the same result but it works for me.

Thanks!

xfavalon avatar Sep 27 '21 11:09 xfavalon

I'd like to add a request for persistent-placeholder support. We use it on all our inputs so it would be very helpful.

Currently, this is my solution - but it has had side effects on one or two inputs in the project where we don't want the effect.

Globally, in a .scss file:

.v-text-field .v-label {
	transform: translateY(-18px) scale(0.81) !important;
}

IOIIOOIO avatar Jan 06 '22 11:01 IOIIOOIO

Doesn't it already work with option fieldProps: {persistentPlaceholder: true} ?

albanm avatar Jan 06 '22 12:01 albanm

Doesn't it already work with option fieldProps: {persistentPlaceholder: true} ?

Perhaps I'm doing it wrong? I'm not sure where to put that in this example:

schema: {
		"type": "object",
		"properties": {
			"stringProp": {
				"fieldProps": {"persistentPlaceholder": true},
				"type": "string",
				"title": "I'm a string",
				"description": "This description is used as a help message.",
			},
		}
	},

IOIIOOIO avatar Jan 06 '22 13:01 IOIIOOIO

schema: {
		"type": "object",
		"properties": {
			"stringProp": {
				"x-props": {"persistentPlaceholder": true},
				"type": "string",
				"title": "I'm a string",
				"description": "This description is used as a help message.",
			},
		}
	},

or for a more general application:

options="{fieldProps: {persistentPlaceholder: true}}"

albanm avatar Jan 06 '22 13:01 albanm

I'm a numbskull. Just realised that as you replied. Thanks!

IOIIOOIO avatar Jan 06 '22 13:01 IOIIOOIO