You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User InterfaceRelated to the frontend / User InterfacebugIdentifies a bug which needs to be addressedpricingPricing functionalityquestionThis is a question
Please verify that this bug has NOT been raised before.
I checked and didn't find a similar issue
Describe the bug*
When entering purchase order item I use tab and enter keys, and as a result I believe the Auto Pricing is not automatically unchecked when I hit enter after updating item price. As a result, added item loses manually entered price and shows calculated pricing as per supplier price breaks.
Add item:
Result:
Steps to Reproduce
Create purchase order
Hit Add Line Item
Select Part
Use Tab key to navigate to Puchase Price
Enter required price
Hit Enter key
Expected behaviour
Manually entered purchase price is shown in entered item.
For select boxes, checkboxes, and radio buttons, the event is fired immediately when the user makes a selection with the mouse, but for the other element types the event is deferred until the element loses focus.
Hence, the purchase price is not updated until it loses the focus (using mouse or tab key). Now, changing the el.change(function(){}) to el.on('input', function(){})
will fix this issue but I am a bit skeptical about it since this will affect all the other elements throughout the codebase. I can add a new trigger call onInput like the onEdit is defined in forms.js
@rocheparadox I think your second simpler approach would be best. However please note that we are in the middle of a huge refactor of the front-end interface (moving to react).
So, new features for the legacy UI will not be given priority. If you can provide a low-risk bug fix for this, I'm happy to review and merge that. However if you can also check functionality on the new interface that would be appreciated !
@SchrodingersGat, Sure. I will stick with the second option then. I am not a frontend developer and have little to no experience with react. Since, I am familiar with js, I thought I would fix it. I am looking forward to contribute more in python.
User InterfaceRelated to the frontend / User InterfacebugIdentifies a bug which needs to be addressedpricingPricing functionalityquestionThis is a question
Activity
SchrodingersGat commentedon Jul 10, 2024
@dieselburner thanks for reporting.
rocheparadox commentedon Jul 14, 2024
@SchrodingersGat , I will try to fix this.
SchrodingersGat commentedon Jul 14, 2024
Thanks @rocheparadox
rocheparadox commentedon Jul 14, 2024
This issue arises due to the underlying model of the events of forms as defined in forms.js
InvenTree/src/backend/InvenTree/templates/js/translated/forms.js
Line 1634 in 76f8a2e
The jquery documentation for the change event goes as follows
Hence, the purchase price is not updated until it loses the focus (using mouse or tab key). Now, changing the
el.change(function(){})toel.on('input', function(){})will fix this issue but I am a bit skeptical about it since this will affect all the other elements throughout the codebase. I can add a new trigger call onInput like the onEdit is defined in forms.js
InvenTree/src/backend/InvenTree/templates/js/translated/forms.js
Line 301 in 76f8a2e
Since this is more of a design decision, I would like to get your opinion, @SchrodingersGat and @matmair . Thanks.
SchrodingersGat commentedon Jul 15, 2024
@rocheparadox I think your second simpler approach would be best. However please note that we are in the middle of a huge refactor of the front-end interface (moving to react).
So, new features for the legacy UI will not be given priority. If you can provide a low-risk bug fix for this, I'm happy to review and merge that. However if you can also check functionality on the new interface that would be appreciated !
rocheparadox commentedon Jul 15, 2024
@SchrodingersGat, Sure. I will stick with the second option then. I am not a frontend developer and have little to no experience with react. Since, I am familiar with js, I thought I would fix it. I am looking forward to contribute more in python.
Added onInput event for fields in forms - fix for issue inventree#7600
Added onInput event for fields in forms - fix for issue #7600 (#7660)
Added onInput event for fields in forms - fix for issue #7600 (#7660)
Added onInput event for fields in forms - fix for issue #7600 (#7660) (…
Revert "Added onInput event for fields in forms - fix for issue inven…