Conversation
|
@jywarren @sagarpreet-chadha @NitinBhasneria @Shreyaa-s @Shulammite-Aso Please review. We can leave the passing of jest-puppeteer test as of now. The test are correct and are passing locally but it look like travis run with --runInBand to fasten te process which fails the test.locally it can be simulated by node ./node_modules/.bin/jest --runInBand . |
|
I just need to make one testing commit. It's working in mine. I hope that's okay @keshav234156 ? |
|
Didn't work. |
|
I just got to testing this in GitPod! Below is my screenshot. But, i tried using the insert button right where my text says I was also able to confirm that if you just start typing in a blank editor, and try adding the insert at the end, it still gets put at the top. So I think that may be an easier test to write, actually? |
|
I tried implementing to make it insert where the pointer was at the start which would much more intuitive. But wasn't able to do so |
sagarpreet-chadha
left a comment
There was a problem hiding this comment.
Some minor changes,
Also you may want to checkout this on how to add text to caret location.
https://stackoverflow.com/questions/946534/insert-text-into-textarea-with-jquery/946556#946556
Let me know if this link works for you, meanwhile i will read wysiwyg api if this is possible easily.
|
@keshav234156 @jywarren @sagarpreet-chadha please have a look. I made a testing commit here (sorry Keshav) and the tests passed! |
|
@Shreyaa-s Good work for digging up and fixing the test properly!! |
|
@sagarpreet-chadha I tried a lot through the process given in the link. It worked well for markdown mode but not for rich text mode it didn't work. The main difference between them is in markdown mode the text is written in |
|
@Shreyaa-sharmaa good catch 🎉 |
|
@sagarpreet-chadha ok doing it!! |
|
@sagarpreet-chadha Please have a look. the main concern for |
|
Hi Keshav, glad it is working for markdown 🎉 |
|
@sagarpreet-chadha No, it's not |
|
Hi Nitin, okay that makes sense! I found one solution here: https://stackoverflow.com/questions/2920150/insert-text-at-cursor-in-a-content-editable-div |
|
@sagarpreet-chadha the main problem with this is that |
|
Hi, i'm thinking - surely there is a standard |
|
@jywarren No that doesn't work because when we are typing input then caret position is changed. that how I have implement and its works like this as shown above #568 (comment) |
|
Oh, i see! Strange! Um, so, the start position is then lost? Actually i believe the chunks state is saved for all previous states, because that's how |
|
Okay @keshav234156 , I got the problem so when we are clicking
@jywarren what do you think? |
|
let's try it! Great thinking, @sagarpreet-chadha ! |
|
@sagarpreet-chadha Please review!! |
sagarpreet-chadha
left a comment
There was a problem hiding this comment.
Great work so far 🎉
Can you send a working gif of insert at caret please. Thanks 😄
It may not work in firefox as written in mdn documentation.
|
Great! I'll give this a try in gitpod!!! https://gitpod.io/#https://github.com/publiclab/PublicLab.Editor/pull/568 |
jywarren
left a comment
There was a problem hiding this comment.
Just one small change on modularizing the code into 2 files for readability. Then we can merge!
This is because after plane text is inserted in rich mode. To apply the styling it going to markdown mode and then back to rich mode. It' s a separate issue. We can fix this in follow-ups!! |
|
I will fix #546 on similar lines once this is merged. |
|
Hmm. Looks like one Travis run is stuck. I'll try restarting it... |
|
Done!!!! Great work, @keshav234156 !!!! 🎉 This can be released with |
|
Updating for inclusion in |
|
Awesomeee great work here @keshav234156 , looking forward to see this feature live very soon 🎉 |






Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!
grunt jasminefixes #0000-style reference to original issue #@publiclab/reviewersfor help, in a comment belowIf tests do fail, click on the red
Xto learn why by reading the logs.Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software
We have a loose schedule of reviewing and pulling in changes every Tuesday and Friday, and publishing changes on Fridays.
Thanks!