mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-27 20:12:40 +00:00
"Removed '%' symbol handling from zoom input value"
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user