From 0c9958f4616585a31d5152ab9dd5e306edb4c1d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sun, 2 Jun 2024 16:05:57 +0200 Subject: [PATCH] "Removed '%' symbol handling from zoom input value" --- client/homebrew/brewRenderer/toolBar/toolBar.jsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/homebrew/brewRenderer/toolBar/toolBar.jsx b/client/homebrew/brewRenderer/toolBar/toolBar.jsx index ba30da4a9..e11081eb0 100644 --- a/client/homebrew/brewRenderer/toolBar/toolBar.jsx +++ b/client/homebrew/brewRenderer/toolBar/toolBar.jsx @@ -45,14 +45,13 @@ const ToolBar = ({ updateZoom, currentPage, onPageChange, totalPages }) => { }; const handleInputChange = (value, type) => { - // Remove the "%" symbol from the input value - const newValue = parseInt(value.replace('%', ''), 10); + const newValue = parseInt(value, 10); // Check the type of input (zoom or page) if (type === 'zoom') { // Check if zoom level is within the allowed range if (newValue >= 10 && newValue <= 300) { - setZoomInput(newValue + '%'); // Add "%" back to the value + setZoomInput(newValue); } } else if (type === 'page') { // Check if page number is within the allowed range @@ -83,7 +82,7 @@ const ToolBar = ({ updateZoom, currentPage, onPageChange, totalPages }) => { onChange={(e) => handleInputChange(e.target.value, 'zoom')} onBlur={(e) => { const newZoomLevel = parseInt( - e.target.value.replace('%', ''), + e.target.value, 10 ); if (newZoomLevel !== state.zoomLevel) {