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

Input components inside DataTable break when upgrading from PrimeVue 1 to PrimeVue 2 #1330

Closed
wanglin86769 opened this issue Jun 9, 2021 · 5 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working vue2
Milestone

Comments

@wanglin86769
Copy link

Input components inside DataTable work properly in PrimeVue 1.3.2, but when upgrading to PrimeVue 2 like 2.4.2, the focus (cursor) of a input component suddenly switch to another input component when stroking the keyboard to input data.

The following is the sample code.

<template>
	<div class="p-grid">
		<div class="p-col-12">
			<h1 style="text-align: center">Funds</h1>
			<Button label="Add" icon="pi pi-plus" @click="addFund" />
			<DataTable :value="funds" >
				<Column field="title" headerStyle="width: 30%">
					<template #header>
						Subject
					</template>
					<template #body="slotProps">
						<Textarea style="width: 100%; margin-top: 5px; margin-bottom: 5px;" v-model="slotProps.data.title" :autoResize="true" rows="5"/>
					</template>
				</Column>
				<Column headerStyle="width: 10%" bodyStyle="text-align: center">
					<template #header>
						Period
					</template>
					<template #body="slotProps">
						<InputMask style="width: 100px" mask="9999-99-99" v-model="slotProps.data.start" placeholder="start date" />
						<div style="text-align: center">to</div>
						<InputMask style="width: 100px" mask="9999-99-99" v-model="slotProps.data.end" placeholder="end date" />
					</template>
				</Column>
				<Column field="amount" headerStyle="width: 10%">
					<template #header>
						amount
					</template>
					<template #body="slotProps">
						<InputText style="width: 100px" type="text" v-model.number="slotProps.data.amount" />
					</template>
				</Column>
				<Column headerStyle="width: 5%" bodyStyle="text-align: center" > 
					<template #header>
						<i class="pi pi-cog" style="font-size: 1.5em"></i>
					</template>
					<template #body="slotProps">
						<i class="fa fa-minus-circle" @click="removeFund(slotProps.index)" style="font-size: 1.75em; color: red"></i>
					</template>
				</Column>
			</DataTable>
		</div>
	</div>
</template>

<script>

export default {
	data() {
        return {
			funds: [],
        }
	},
	methods: {
		addFund() {
			this.funds.push({});
		},
		removeFund(index) {
            this.funds.splice(index, 1);
		},
	}
}
</script>
@sid-6581
Copy link
Contributor

sid-6581 commented Jun 9, 2021

Does it work in 2.3.0? All the 2.4.x releases have been so broken they've been unusable for us.

@wanglin86769
Copy link
Author

Does it work in 2.3.0? All the 2.4.x releases have been so broken they've been unusable for us.

No, it does not work in 2.3.0, 2.2.0 or 2.1.0, only works in 1.3.2 or probably other 1.x

@tugcekucukoglu tugcekucukoglu added Status: Pending Review Issue or pull request is being reviewed by Core Team vue2 labels Jun 15, 2021
@tugcekucukoglu
Copy link
Member

With PrimeVue 2.4.2, I could not replicate it. https://codesandbox.io/s/exciting-sanne-8tcu3

What is your exact test case? Without codesandbox it's really hard to say something.

@wanglin86769
Copy link
Author

@tugcekucukoglu
Please refer to the following codesandbox. You may want to click the 'Add' button to add a row, and try to input characters in every input components.
https://codesandbox.io/s/stupefied-lichterman-ihupt

@zsuzsmuzs
Copy link

The problem might be with the InputMask. I had issues with that one as well.

@cagataycivici cagataycivici self-assigned this Jul 26, 2021
@cagataycivici cagataycivici modified the milestones: 3.6.0, 3.6.1 Jul 26, 2021
@cagataycivici cagataycivici removed their assignment Jul 26, 2021
@cagataycivici cagataycivici modified the milestones: 3.6.1, 3.6.2, 3.6.3, 3.6.4 Aug 5, 2021
@mertsincan mertsincan modified the milestones: 3.7.0, 2.5.2 Aug 26, 2021
@yigitfindikli yigitfindikli removed the Status: Pending Review Issue or pull request is being reviewed by Core Team label Sep 29, 2021
yigitfindikli added a commit that referenced this issue Sep 29, 2021
@tugcekucukoglu tugcekucukoglu added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working vue2
Projects
None yet
Development

No branches or pull requests

7 participants