Repository: randyzwitch/streamlit-folium (language: python)

Issue:
Editing+Saving modified drawn layer does not update geometry
Thanks a lot for this great library!

I'm using streamlit-folium in [mapa-streamlit](https://github.com/fgebhart/mapa-streamlit) and I believe we have found a bug.

### Observed Behavior
When drawing a rectangle on the folium map, the streamlit app "Running" mode seems to get triggered whenever the rectangle was finished drawing. I can then access the resulting geojson geometry of the rectangle. That is expected and in line with the desired behavior. However, if I now were to edit the drawn rectangle using the "Edit layers" button (see below picture), the streamlit "running" mode does not get triggered when I click on "Save". At the same time, if I inspect the given geojson geometry, it is still the same and did not get updated to the modified geometry.

### Desired Behavior
Updating a drawn layer (e.g. a rectangle) using the edit button updates the output of `st_folium`.

Picture for reference:
<img width="177" alt="Screenshot 2022-04-10 at 10 59 53" src="https://user-images.githubusercontent.com/16943048/162611245-d407d265-bbaa-4cda-8de7-675bde1570b3.png">




Discussion / hints:

Fix patch:
diff --git a/setup.py b/setup.py
index b494d2d..2791e89 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
 
 setuptools.setup(
     name="streamlit_folium",
-    version="0.6.4",
+    version="0.6.5",
     author="Randy Zwitch",
     author_email="randy@streamlit.io",
     description="Render Folium objects in Streamlit",
diff --git a/streamlit_folium/frontend/src/index.tsx b/streamlit_folium/frontend/src/index.tsx
index f9c3793..c57c580 100644
--- a/streamlit_folium/frontend/src/index.tsx
+++ b/streamlit_folium/frontend/src/index.tsx
@@ -125,6 +125,8 @@ function onRender(event: Event): void {
           layer.on("click", onLayerClick)
         }
         map.on('draw:created', onDraw);
+        map.on('draw:edited', onDraw);
+        map.on('draw:deleted', onDraw);
 
         Streamlit.setFrameHeight()
         updateComponentValue();


Test patch:
diff --git a/.github/workflows/run_tests_each_PR.yml b/.github/workflows/run_tests_each_PR.yml
index 15e4c07..445cbaa 100644
--- a/.github/workflows/run_tests_each_PR.yml
+++ b/.github/workflows/run_tests_each_PR.yml
@@ -5,12 +5,11 @@ name: Run tests each PR
 
 on:
   push:
-    branches: [ master ]
+    branches: [master]
   pull_request:
-    branches: [ master ]
+    branches: [master]
 
 jobs:
-
   build:
     runs-on: ubuntu-latest
     strategy:
@@ -18,39 +17,39 @@ jobs:
         python-version: [3.7, 3.8, 3.9]
 
     steps:
-    - uses: actions/checkout@v2
-    - name: Set up Python ${{ matrix.python-version }}
-      uses: actions/setup-python@v2
-      with:
-        python-version: ${{ matrix.python-version }}
-    - name: install node
-      run: |
-        sudo apt install nodejs npm
-        npm --version
-    - name: build streamlit-folium JS
-      run: |
-        cd streamlit_folium/frontend/
-        npm install
-        npm run build
-    - name: Install python dependencies
-      run: |
-        python -m pip install --upgrade pip
-        pip install flake8 pytest
-        # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
-        if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
-        pip install -e .
-    - name: Lint with flake8
-      run: |
-        # stop the build if there are Python syntax errors or undefined names
-        flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
-        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
-        flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
-    - name: Install chromedriver
-      run: |
-        seleniumbase install chromedriver 98
-    - name: Start Streamlit app
-      run: |
-        streamlit run examples/streamlit_app.py &
-    - name: Test with pytest
-      run: |
-        pytest
+      - uses: actions/checkout@v2
+      - name: Set up Python ${{ matrix.python-version }}
+        uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.python-version }}
+      - name: install node
+        run: |
+          sudo apt install nodejs npm
+          npm --version
+      - name: build streamlit-folium JS
+        run: |
+          cd streamlit_folium/frontend/
+          npm install
+          npm run build
+      - name: Install python dependencies
+        run: |
+          python -m pip install --upgrade pip
+          pip install flake8 pytest
+          # if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+          if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
+          pip install -e .
+      - name: Lint with flake8
+        run: |
+          # stop the build if there are Python syntax errors or undefined names
+          flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+          # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
+          flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+      - name: Install chromedriver
+        run: |
+          seleniumbase install chromedriver 100
+      - name: Start Streamlit app
+        run: |
+          streamlit run examples/streamlit_app.py &
+      - name: Test with pytest
+        run: |
+          pytest