bootstrap-table
bootstrap-table copied to clipboard
Fix #6399, HTML-formatted editable fields, issue #6399
Fix described on https://github.com/wenzhixin/bootstrap-table/issues/6399
🤔Type of Request
- [x] Bug fix
- [ ] New feature
- [x] Improvement
- [ ] Documentation
- [ ] Other
🔗Resolves an issue?
📝Changelog
- [ ] Core
- [x] Extensions
💡Example(s)?
☑️Self Check before Merge
⚠️ Please check all items below before review. ⚠️
- [ ] Doc is updated/provided or not needed
- [ ] Demo is updated/provided or not needed
- [ ] Changelog is provided or not needed
Please update changelog, if this merge request will be accepted. Thanks!
The changes are made in the dist folder instead of the src folder, which means the PR is currently invalid. Please reapply the changes to the source folder and also provide us examples using our editor.
Hello @UtechtDustin !
Example provided at https://live.bootstrap-table.com/code/utilmind/12883 (see window.tablePrice() method and Price column in the table, with broken HTML formatting due to unescaped "-characters within attributes of the HTML tag).
The source code also updated with minor optimization to avoid conversion of template literals to slow concat()'s, during es6 -> es5 translation. (MDN recommends to use the string concatenation operators (+, +=) instead of concat() method for perfomance reasons. Discussion at https://stackoverflow.com/questions/16124032/js-strings-vs-concat-method).
Sorry for the late feedback it seems we all are quite busy right now. The PR should only update the source code, the dist code will be updated while realeasing a new version.
@UtechtDustin now suggested updates are only in source code file. Other changes (in dist folder) reverted to original.
I tried to test you're changes with you're fork (https://live.bootstrap-table.com/code/UtechtDustin/14259). But the editor is broken, because you're fork is not up to date with our develop branch. Please fix that, so we can test it with our editor.
@UtechtDustin I have pulled latest updates and did the fix again. I hope this fix will not be ignored during next 6 months :)
It really fixes the described issue #6399 of HTML formatted editable values.
Thanks!
Please provide us an working example, i'm was not able to create one with you're PR.
Please provide us an working example, i'm was not able to create one with you're PR.
Please see an example mentioned above on Sept 19:
Example provided at https://live.bootstrap-table.com/code/utilmind/12883 (see window.tablePrice() method and Price column in the table, with broken HTML formatting due to unescaped "-characters within attributes of the HTML tag).
Basically this is the table with HTML-formatted values:
And this is how it should look like, after suggested patch:
I saw that example, but it uses the version 1.21.0.
If i run the example with you`re PR (utilmind:develop) the whole table crashes.
@UtechtDustin ok, here is an example which supposed to get sources from utilmind:develop: https://live.bootstrap-table.com/code/utilmind/15558 It loads bootstrap-table properly.
However, the example not include my fix. I opened the source code and see that it still use "editable" from CDN.
In either case, I guarantee that it fixes the mentioned issue since September 2022. Please include it to canonical sources. I'm ready to provide example, but not via https://live.bootstrap-table.com/, since it doesn't works properly or I'm not understand how to use it and actually don't want to figure out since it takes too much time. It already took too much time and lasts 9 months, so I would prefer to give up if my improvement can't be accepted. Thanks.
UPD. actually still figuring out...
You did it correctly and the editor works fine! What you marked in red is just the x-editable plugin not the edtiable bootstrap-table plugin! Check the second script tag on the body, it's the develop branch of your fork.
@UtechtDustin now it's really fixed: https://live.bootstrap-table.com/code/utilmind/15567 Removed 1 odd line of code and purged jsDelivr cache to reflect update.
Seems working now, thanks!
We will merge it, as soon the linting issues are fixed.
Thank you!