Closed peteward closed 6 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
@peteward I'd like to hear your opinion on this feature.
I think an input UI for a number range from 0 to 1 would be better since the slider UI seems a bit exaggerated. Also, similar to rotate, I believe we need controls such as disabling it when opacity is not specified in the plugin's propPanel.defaultSchema.
If you agree with the above, I can continue with the implementation on my end.
Personally, I don't think it's an absolutely necessary feature, but if it doesn't interfere with the designer's UI, I do think it's a nice feature to have.
@hand-dot ,
Whilst not a high priority feature, it clearly has a use-case for @LeandroBanaszeski and it seems quite simple for both the UI and pdf-lib so I think we should add it.
I think the slider is OK, but not at full width, it takes up too much space. It also seems a to be visually clipped at the edges, and buggy when I put it at the end of a row - it causes the UI to refresh for me. So, perhaps just keep it simple with a number input.
Agree that we should make it optional 👍
If the items on the sidebar get much higher, we might need to consider making the sidebar wider so that we can fit 4 number widgets on one row (and/or adjust the CSS to reduce horizontal padding slightly).
But one more row for now should be OK...
@peteward Thank you for your opinion. I will ask for a review once the implementation is done.
Thank you always
Hey @peteward, Could you pls review ?
Opacity Works like this.
https://github.com/pdfme/pdfme/assets/24843808/3884471d-439c-4c94-97f5-8a2b285c8ecc
Also fix rotate degrade: https://github.com/pdfme/pdfme/pull/337
https://github.com/pdfme/pdfme/assets/24843808/7a6bec3d-bfa3-4951-be49-4a1cd4219494
Hey @peteward
What was the fix for the rotation issue?
The most recent commit should have fixed both issues.
https://github.com/pdfme/pdfme/assets/24843808/fdda8c3f-a16b-47a3-ad35-3dcd511cd773
I uploaded a version of the schema after removing the optional rotation field to trigger the bug.
Where should i check?
I apologize for ending up combining both the opacity feature and rotate bug fix into one PR, even though you had separated them into different PRs...
no need to apologise, great work! I am sorry for breaking it :D
I can confirm this fix with the local template I made
Hi @hand-dot,
This appears to have introduced a new issue:
https://github.com/pdfme/pdfme/assets/7068515/af2808fe-2ced-4847-8a5d-d42512d33145
@peteward
Oh....., okay i'll check it! thank you!
@peteward Reproducing the issue is not possible, is there something wrong with the procedure?
https://github.com/pdfme/pdfme/assets/24843808/004d7e51-a20f-4674-8900-546b1131608f
Apologies for the slow reply. I will try a fresh checkout on this later today and confirm.
I've done a fresh checkout, switched to this branch and built as before. I'm seeing the same bouncing behaviour when I edit more than one input on a schema.
Ok, I have figured this out with @steffancarrington's help!
I think there is a bug here that container or screen size changes that trigger re-render should not lose the selected schema state, but it is not related to this PR.
I will log this separately to look at.
hmm on second thoughts, I think it is something in this PR.
I will try again to find it tomorrow.
Hey, @peteward
Thank you for taking the time to debug. I respect your thorough quality check.
OK, I'll still hold off on merging this. However, I don't want the PR to become outdated and neglected, so please feel free to let me know if there's anything. I will also do some debugging on my end.
this is very strange...
I think it is related to a LastPass browser extension that I have.
What is strange is that just adding the opacity
field definition in creates the problem and seems to activate LastPass on the form. If I comment this out, then I do not see LastPass running on these fields:
opacity: {
title: i18n('opacity'),
type: 'number',
widget: 'inputNumber',
disabled: defaultSchema?.opacity === undefined,
dataLpignore: true,
max: 1,
min: 0,
span: 8,
},
->
I don't know what it is about this field that seems to trigger Lastpass.
I will try to look at what is losing the schema selection when the screen resizes, I think this will resolve the issue.
@hand-dot, the issue I was seeing was due to Lastpass triggering a resize of the component which caused the <React.StrictMode>
issue to rerender the screen (#347)
This PR should be good to merge :+1:
@peteward Thank you!
@LeandroBanaszeski Thank you for your contribution!
Ref: https://github.com/pdfme/pdfme/issues/336
Opened on behalf of @LeandroBanaszeski