DataTable : (row) editing + selection column - focus issues #315
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Hello,
vue-newbie here, so please bear with me if I am off-topic or plain wrong - which is very possible.
While implementing a row-level edit on a
DataTable
, I found some surprising behaviours when there is a selection first column before theInputText
being edited:a) In such a configuration, when I press the
rowEditor
, theInputText
is properly opening as expected, but it does not have focus. The focus is set on the selection column.b) Even when refocusing the
InputText
, there is another surprising behaviour (only when the edited field is not (yet) existing in the data object - field not present at all) :In that case, when you click of the
rowEditor
, theInputText
is properly opening as expected (you need to put the focus manually on theInputText
as just said before).Then when you click on the
InputText
to add some text, you can only press the first character, and then the focus is lost (in fact is again transferred to the selection column). You need to either press "Tab" or click again in theInputText
.However this (strange) behaviour of focus loss does not seem to occur when the edited field is already existing in the data object (either with a value, or null).
Here is a test case:
Setup a brand new hello-world vue project ("core-js": "^3.6.4", "primeflex": "^1.1.0", "primeicons": "^2.0.0", "primevue": "^1.3.2", "vue": "^2.6.10")
Add the following to main.js:
yarn serve
DataTable
that just displayed, click on the first edit icon on the right, on the first line.InputText
as expected (strange behaviour (a))InputText
(either with Tab or the mouse), then try to enter some text (more than 1 character). Observe that only the first character is entered in theInputText
, and that the focus is again on the checkbox (strange behaviour (b))May be behaviour (b) is by design, and I don't mind having to defined the properties on the object beforehand.
But I'm surprised by behaviour (a) for which I do not have satisfying a workaround, other than:
InputText
Any idea ?
The text was updated successfully, but these errors were encountered: