An electronic device which is equipped with a touch panel, comprising: a plurality of electrostatic capacitive sensors which are disposed in the touch panel, and an electrostatic capacitance of which varies as an object comes close or comes into contact; a measurement unit configured to measure the respective electrostatic capacitance of the electrostatic capacitive sensors; a first detection unit configured to detect whether the object comes close or comes into contact on the basis of a difference between a measurement value of the measured electrostatic capacitance and a base line value; and an update unit configured to update the base line value to cause the base line value to follow up the measurement value of the electrostatic capacitance of the respective electrostatic capacitive sensor to correct a variation in electrostatic capacitance of the electrostatic capacitive sensor, characterised by a second detection unit configured to detect an approaching object to the touch panel; and a control unit configured to control an update speed of the update unit on the basis of a detection result of the second detection unit, wherein the second detection unit comprises an infrared, IR, sensor for detecting the approaching object to the touch panel, the IR sensor comprising a light-emitting element for emitting infrared light and a light-receiving element for receiving reflected light of the emitted infrared light, wherein the IR sensor is attached in a side portion of the touch panel in a way that a detection range of the IR sensor is larger than a detection range of the first detection unit, wherein the control unit is configured to set the update speed of the base line value by the update unit to a slow speed which is slower than a predefined value when the second detection unit detects an approaching object, and wherein the control unit is configured to set the update speed of the base line value by the update unit to a fast speed which is faster than the predefined value when the second detection unit does not detect an approaching object. a plurality of electrostatic capacitive sensors which are disposed in the touch panel, and an electrostatic capacitance of which varies as an object comes close or comes into contact; a measurement unit configured to measure the respective electrostatic capacitance of the electrostatic capacitive sensors; a first detection unit configured to detect whether the object comes close or comes into contact on the basis of a difference between a measurement value of the measured electrostatic capacitance and a base line value; and an update unit configured to update the base line value to cause the base line value to follow up the measurement value of the electrostatic capacitance of the respective electrostatic capacitive sensor to correct a variation in electrostatic capacitance of the electrostatic capacitive sensor, characterised by a second detection unit configured to detect an approaching object to the touch panel; and a control unit configured to control an update speed of the update unit on the basis of a detection result of the second detection unit, wherein the second detection unit comprises an infrared, IR, sensor for detecting the approaching object to the touch panel, the IR sensor comprising a light-emitting element for emitting infrared light and a light-receiving element for receiving reflected light of the emitted infrared light, wherein the IR sensor is attached in a side portion of the touch panel in a way that a detection range of the IR sensor is larger than a detection range of the first detection unit, wherein the control unit is configured to set the update speed of the base line value by the update unit to a slow speed which is slower than a predefined value when the second detection unit detects an approaching object, and wherein the control unit is configured to set the update speed of the base line value by the update unit to a fast speed which is faster than the predefined value when the second detection unit does not detect an approaching object.